Pregunta

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:

  1. I need compatibility with Windows XP?
  2. I don't need compatibility with Windows XP?

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.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top