I am currently working on a project to show a 2d graphical representation of a Gerber file. The function draws each element from a list, with possibly about 50,000 shapes in my current test file.
My initial method using drawing functions in the system drawing namespace, which I think uses GDI+, and rendering to an off screen bitmap but proved too slow, especialy when having to re draw the bitmap everytime the user zoomed in or moved the image.
I then looked to using direct 2d in slim dx library but this was actually slower, which didn't seem correct (can anyone offer any insight to this??? I made a test file drawing 1000000 elipse shapes in random locations to test and could/may upload if i find time)
I am just looking for an idea for a next step. I was wondering whether I should look into using direct3d11 instead of direct2d. Some people recommend XNA, but I thought more for game design.
Any ideas will be welcomed...
Nick
The first thing you should do is to draw only the visible object. Don't try to draw anything that is outside of the screen. This will limit the number of shapes that needs to be drawned.
If the list of shapes don't change often, you could draw them in a bitmap and then only zoom/scale/translate the bitmap. That way, you don't need to draw the shapes every time.
An other technique is to make the user experience more smooth, not really faster by using double buffer. http://msdn.microsoft.com/en-us/library/b367a457.aspx
GDI+ should be fast enought.