2D graph drawing in windows with unmanaged code callable from excel

I want to be able to input a list of nodes into an excel spreadsheet and pop up a zoomable window with a graph of those nodes. Requirements are: For the graph to be quite large (typically 40+ nodes, 200+ edges). The project to be distributed with the minimum of dependencies. The project to run in a minimum privilege environment. Zooming and scaling of the rendered graph to be "smooth". Targeting win7 / vista sp2.

I know how to build to layout of the graph but I am unsure of the best way to render it. I need to render what comes down to a list of cubic splines and rectangles.

I am leaning away from using excel shapes or drawings using the vb6/userform for performance reasons.

My current plan is to build the render code into a dll (coded in C or C++) which is shipped with the spreadsheet and simply lives in the same folder, calling the dll and marshalling the data are no problem.

The bit I am unsure of is the best technology to use in the dll to render the graph. The options as I see them are: 1. GDI 2. GDI+ 3. Direct2d 4. Direct3d

My understanding is that in the latest version of windows GDI and GDI plus are un-accelerated and relativity slow. Direct2d appears to be needlessly complicated. Direct3d appears in principal to be easier than direct2d, but has poor text/font handling in the latest version.

Which option 1 to 4 would be people recommend as the best fit to the requirements, are there any other options that I am missing. Given the size of the graphs and the zooming requirement how much weight is reasonable to put behind performance and how big a factor should this be?

链接地址: http://www.djcxy.com/p/50346.html

上一篇: C#

下一篇: 在窗口中使用可从excel调用的非托管代码的2D图形绘图