用于平移和缩放 5000x5000 图片的 WPF 或 DirectX?
我当前的代码是带有自定义图像视图的普通 WPF。我需要平移和缩放非常高分辨率的图片,但当然需要大量的 CPU 能力才能完成此操作。
我的问题是:如果我将控件从图像视图更改为 directX 之类的控件,这会大大增加我的缩放和平移体验还是不会有这么大的差异? (我们使用的显卡是 Nvidia ion2,CPU 是最高 2 Ghz 的 intelatom)
my current code is normal WPF with a custom image view. I need to pan and zoom a very high resolution picture but of course it needs a lot of CPU-Power to do this.
My question is: if I change the control from a image view to something like directX will this increase my zoom and panning expirience a lot or isnt there such a big difference?
(The graphic card we use is a Nvidia ion2 and the CPU is a intel atom with up to 2 Ghz)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
2D 加速并不像 3D 那样完善。请参阅此处的基准。
我相信使用图片作为纹理并控制相机进行平移和缩放应该会大大提高性能。
2D acceleration is not as perfected as 3D is. See benchmarks here.
I believe using the picture as a texture and controlling the camera for pan and zoom should increase performance a lot.
据我所知,WPF 使用 DirectX 来呈现其内容,因此我认为这不会给您带来高性能提升。
如果您遇到性能问题,我认为答案是检查您的缓存算法。
From my knowledge WPF uses DirectX to render its content, so I wouldn't think that would give you a high performance boost.
If you're having performance issues I would think the answer is in looking through your caching algorythm.
WPF 图形功能不是很强大。我们已经在Direct3D9中进行了所有图形渲染,并且仅在D3DImage控件中显示3D场景。
在谈论大型位图渲染时,我们发现最好的方法是创建 Direct3D 纹理。它的创建速度相当快,当图像尺寸小于 GPU 本身支持的尺寸(caps.MaxTextureWidth、caps.MaxTextureHeight)时,渲染本身也非常快。通常为 8k x 8k 或 16k x 16k。谈论数百 MB 的位图,也应该足够您使用。
要查看它可以获得的性能,您可以下载我们的图表控件,设置一个大位图作为背景图像到地理地图。然后您还会看到缩放和缩放的速度有多快。平移等。肯定击败 WPF 内置图像处理:-)
(我是 Arction 的 LightningChart 开发人员之一)
WPF graphics isn't very powerful. We have made all graphics rendering in Direct3D9, and only displaying the 3D scene in D3DImage control.
When talking about large bitmap rendering, we've found the best way is to create a Direct3D texture. The creating of it reasonably fast, and rendering itself is very fast when the image dimensions is less than natively supported by the GPU (caps.MaxTextureWidth, caps.MaxTextureHeight). That typically is 8k x 8k or 16k x 16k. Talking about bitmaps of hundreds of MB, and should be sufficient for your use too.
To see the performance that can be obtained with it, you can download our Chart control, set a large bitmap to background image to a Geographic map. Then you see also how fast is it too zoom & pan etc. Beats WPF built-in image handling for sure :-)
(I'm one of LightningChart developers at Arction)