WPF Scale Transform 和 ScrollViewer - 缩放时无法滚动超出原始大小
我在 ScrollViewer 中有一个 StackPanel。
我有一个滑块,可以在堆栈面板上进行缩放变换,以允许放大和缩小功能。问题是,当我放大时,滚动查看器不会将内容视为“更大”。
因此,如果我滚动一点并尽可能向右滚动 - 它会在我到达内容末尾之前阻止我。如果我缩小到未变换的水平,我会发现它正好停在那个点。如果我放大很多,当我一直滚动时我只能看到全部内容的一小部分。
我可以更改 TransformOrigin 来控制哪一侧丢失的内容最多;但我认为滚动查看器(或其他控件?)应该有某种方式来为我处理它。
I have a StackPanel inside of a ScrollViewer.
I have a slider that does a scale transform on the stackpanel to allow zoom-in and zoom-out functionality. The problem is that when I zoom in, the scrollviewer doesn't treat the content as being 'bigger'.
So, if I scroll in a little and scroll as far right as I can go - it stops me before I get to the end of the content. If I zoom back out to the untransformed level, I see that it's stopping exactly at that point. If I zoom in a lot, I can only see a small fraction of my total content when I scroll all the way over.
I can change the TransformOrigin to control which side loses the most content; but I figure there should be some way for the scrollviewer (or another control?) to take care of it for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是在做渲染变换,还是布局变换?你应该做后者。
Are you doing render transform, or layout transform? You should be doing the latter.