ImageBrush.Transform错误功能 [英] ImageBrush.Transform error function
问题描述
嗨!
我开发了一个silverlight项目,在其中用ImageBrush填充了多个椭圆,然后将图像复制到椭圆下.我对该ImageBrush应用了两种转换:ScaleTransform和TranslateTransform,以显示图像的唯一部分,即 在椭圆下.然后,对椭圆应用效果.
I developed a silverlight project where I fill several ellipses with an ImageBrush, copying the image under the ellipse. I apply two transformations to that ImageBrush: ScaleTransform and TranslateTransform, to show the only the part of the image that is under the ellipse. Then, I apply an effect to the ellipse.
好吧,我想在其他WPF应用程序中显示这些效果(我将它们保存到数据库中并获取了它们).但是当我将tra TranstransTransform或ScaleTransform应用于ImageBrush时,根据其值,椭圆中的填充图像会消失 在椭圆的一部分.似乎该变换仅应用于可见部分,而不应用于被ImageBrush填充椭圆的整个图像.
Well, I want to show these effects in other WPF applications (I save them into a database and get them). But when I tray to apply tra translateTransform or the ScaleTransform to the ImageBrush, depending of the value, the filled image in the ellipse disappears in part of the ellipse. It seems like the transformation is applied only to the visible part and not to the entire image that is filling the ellipse with the ImageBrush.
有人知道出什么问题吗?
Anybody knows what is the problem?
非常感谢.
推荐答案
您可以尝试通过另一种方式实现此功能: 裁剪
You might try to implement this feature through another way: Clipping
只需添加图像并将其Clip属性设置为EllipseGeometry,即可获得相同的效果.
Just add an image and set its Clip property as an EllipseGeometry, then you should get the same effect.
By the way, this link and this link might help.
这对您有帮助吗?
这篇关于ImageBrush.Transform错误功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!