一个 ScaleTransform 到一组图层
这就是我想要做的 - 给定滚动查看器内的几个[图像]层,我想对所有层应用相同的缩放因子。
在 Xaml 中,我有一个滚动查看器,它托管一个网格,该网格托管两个图像控件。我有一个复选框可以控制顶部图像的可见性。现在,我对每个图像都有一个比例变换,并对两个图像应用相同的比例。
有没有一种方法可以在一个容器中统一缩放?
Here's what I want to do - given a couple of [image] layers inside a scrollviewer, I'd like to apply the same scaling factor to all layers.
In Xaml, I have a scroll viewer that hosts a grid that hosts two image controls. I have a checkbox that controls the visibility of the top image. Right now, I have a scaletransform for each image, and apply the same scale for both.
Is there a way to unify scaling in just one container?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,您可以在更高级别应用比例变换,例如您可以将其应用到网格。
这将自动将变换传播到最终位于该网格内的任何子级。
问候,
多诺万
Sure you can just apply the scale transform at a higher level, e.g. you could apply it to the grid.
That will automatically propagate the transform down to any child that ends up inside that grid.
Regards,
Donovan