问题描述
我一直使用C ++ / CLI写了一个简单的基于GDI的数据绘图仪,但它不是特别快(一些基本的分析表明它的渲染筛选这就是问题所在)。
I've written a simple GDI-based data plotter using C++/CLI but it's not particularly fast (some basic profiling indicates it's the rendering to screen that's the problem).
有没有什么办法可以启用硬件加速的用户控件,还是有一个.NET接口Direct3D的? ...还是有一些其他的选择,我可以考虑一下。
Is there any way to enable hardware acceleration for a UserControl or is there a .net interface for direct3D? ...or are there some other options I could consider.
我们正在使用管理code这样的解决方案,真正需要的CLI兼容的,如果在所有可能的。
We're using managed code so the solution really needs to be CLI compatible if at all possible.
如果有帮助,我撕心裂肺条矩形这是使用每个2×2像素(128个数据点)图形:: FillRectangle
- ?也许有这样做的更好的方式
In case it helps, I'm rending strips (128 data points) of rectangles which are each 2x2 pixels using Graphics::FillRectangle
- maybe there's a better way of doing that?
推荐答案
托管DirectX已经去$ P $。你真的不想使用它。相反,你应该使用 SlimDX 这是一个开源的互操作层的DirectX SDK中的API编写的C ++ / CLI。它比托管DirectX更好,支持开发专家社区。 (我将要努力尽快改善的DirectWrite支持他们。)
Managed DirectX has been deprecated for some time. You really don't want to use that. Instead, you should use SlimDX which is an open source interop layer for the DirectX SDK APIs written in C++/CLI. It is better than Managed DirectX and is supported by an expert community of developers. (I'm going to be working on improving the DirectWrite support with them soon.)
这篇关于找了快于GDI解决方案,使动态数据图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!