开发者

Wpf 4 TranslateTransform animation is not smooth when some effect applied

We have a kind of Carousel control in our app: bunch of icons are spinning around (TranslateTransform and DoubleAnimation are used to move icons in circle). Icon is just an Image with DropShadowEffect. In .NET 3.5 animation was smooth. I've recently switched to the .NET 4 and icons now "jump", ani开发者_如何学Pythonmation is not smooth.

I've tried to remove DropShadowEffect and it solved the problem. Is there a way to smoothly animate elements with Effect? I've tried things like UseLayoutRounding, BitmapScalingMode. May be there is some setting that I do not know of?

Update It is not a performance problem. Basically, I've added some text above the image (the object to animate is a Grid with TextBlock and Image). After that text moves smoothly, and Image does not. Like it is not moving by one pixel, but by two pixels. Looks like layout works different when there is an Effect applied.


DropShadowEffect is quite resource intensive, so it's likely the computer cannot handle it in time to make the animation smooth. Perhaps you could simulate a drop shadow using a border or something else, instead of using the DropShadowEffect. See this thread for more information.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜