开发者

Performance problem when applying a RenderTransform to a Viewport3d in WPF

开发者 https://www.devze.com 2023-01-06 17:16 出处:网络
I have implemented zooming and panning in my WPF app using a RenderTranform combining scaling and translations.

I have implemented zooming and panning in my WPF app using a RenderTranform combining scaling and translations.

Everything is peachy with bitmaps, text, graphic paths, shapes and more. As soon as I put a viewport3d in the visual tree and I zoom into the picture, performance drops to terrible (non-interactive!) levels.

Any suggestions?

I have already read this page http://msdn.microsoft.com/en-us/library/bb613553.aspx and followed all recomm开发者_开发百科endations applicable to my app. That allowed me to zoom in a bit deeper in the view but not enough...


I solved the problem using Cached Composition.

I had to place the Viewport3d into a canvas and use the following code:

    CacheMode = new BitmapCache() 
{ EnableClearType = true, RenderAtScale = 1, SnapsToDevicePixels = true },

Doing the same thing on the viewport itself did not work...

0

精彩评论

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

关注公众号