Reputation: 210475
I have a GDI+ program that I've thoroughly optimized (batching calls with GraphicsPath
, DrawLines
, etc.), but it's still slow at rendering (takes a few seconds to draw a complex map with anti-aliasing).
There is no way to make my GDI+ faster, so I'm looking for an alternative.
What is my next-easiest/lightweight alternative (with at least 20x faster performance or so) for drawing lines/circles/rectangles on the screen with antialiasing, if:
I'm looking into DirectDraw and Direct2D right now, but I haven't even figured out how to draw basic shapes on the screen with them. I might consider OpenGL too, but I'm not sure where to start since I've never used it.
Upvotes: 4
Views: 3297
Reputation: 26259
Direct2D is almost like a swap-in for GDI+, just faster and cleaner. The drawing functions are exposed via the ID2D1RenderTarget
interface.
Unlike Direct2D, GDI+ is not hardware accelerated, so you should notice a huge improvement in speed of rendering. Anti-aliased drawing and alpha-blending operations are part of the package now.
Upvotes: 3