使用WPF滚动图像 [英] Scrolling image with WPF
问题描述
我正在使用.NET Framework4.
我有300MB的大图像,我需要在屏幕上显示该图像,而无需缩放以适合屏幕.
我将图像放在画布中,并通过TranslateTransform操作将其移动.
画布大小与图像相同,但不缩放.
滚动图像时,要花费很多时间.
WPF是否有任何解决方案以获得更好的滚动性能,或者我需要通过计算图像的显示部分并将其仅传输到WPF来进行不同的控制?
Hi,
I''m using .NET framework 4.
I have big image of size 300MB that i need to display on screen without scaling to fit on screen.
I put the image in canvas and let it be moved by TranslateTransform operation.
The canvas size is the same of the image without scaling.
While scrolling the image it takes a lot of time to move it.
Is there any solution from WPF to get better scroll performance or i need to control it differently by calculating the display portion from the image and transfer only it to WPF?
推荐答案
IMO在scrollviewer中具有高性能,它具有以下功能:
IMO for high performance in scrollviewer, there is this feature:
ScrollViewer.IsDeferredScrollingEnabled="True"
有关scrollviewer的一些链接:
http://blogs.msdn. com/b/llobo/archive/2008/06/05/new-features-scrollviewer-isdeferredscrollingenabled-alternationcount-ieditablecollectionview.aspx [ http://msdn.microsoft.com/en-us/library/cc716879.aspx [ ^ ]
A few links regarding scrollviewer:
http://blogs.msdn.com/b/llobo/archive/2008/06/05/new-features-scrollviewer-isdeferredscrollingenabled-alternationcount-ieditablecollectionview.aspx[^]
http://msdn.microsoft.com/en-us/library/cc716879.aspx[^]
这篇关于使用WPF滚动图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!