C# / Silverlight / WPF / Fast rendering lots of circles

Posted by Walt W on Stack Overflow See other posts from Stack Overflow or by Walt W
Published on 2010-02-25T20:56:01Z Indexed on 2010/03/12 19:47 UTC
Read the original article Hit count: 254

Filed under:
|
|
|

I want to render a lot of circles or small graphics within either silverlight or wpf (around 1000-10000) as fast and as frequently as possible. If I have to go to DX or OGL, that's fine, but I'm wondering about doing this within either of those two frameworks first (read: it's OK if an answer is WPF-only or Silverlight-only). Also, if there is a way to access DX through WPF and render on a surface that way, I would be interested in that as well.

So, what's the fastest way to draw a load of circles? They can be as plain as necessary, but they do need to have a radius. Currently I'm using DrawingVisual and a DrawingContext.DrawEllipse() command for each circle, then rendering the visual to a RenderTargetBItmap, but it becomes very slow as the number of circles rises.

By the way, these circles move every frame, so caching isn't really an option unless you're going to suggest caching the individual circles . . . But their sizes are dynamic, so I'm not sure that's a great approach.

© Stack Overflow or respective owner

Related posts about c#

Related posts about Silverlight