开发者

Most efficient way to draw in silverlight

I am rewriting some wpf experiments into silverlight. On wpf I like to work directly with DrawingVisuals which I manually add and remove form a canvas, which gives me great performance with large numbers of elements. But to my surprise there is no such thing as DrawingVisuals in Silverlight. What is then the most efficient way to draw many objects on the screen that are capable of independent anima开发者_高级运维tion (they don’t need to react to mouse events)? Working with shapes has, at least in WPF, a large overhead.


Check out some of the work that is going on around WriteableBitmap such as Bill Reiss's article "Blitting and Blending with Silverlight's WriteableBitmap" and Rene Schulte's articles 1, 2, and 3 on extending the WriteableBitmap.

Jeff Prosise also has a WriteableBitmap sample.

This approach might be lower level than what you are looking for but it's worth checking out.


Shapes are the most basic items that can be independently animated in Silverlight.

Geometries are even more primitive but they can't be addressed by animations. Even if you took on animating them with your own code I'm not sure that would be any quicker.

When the basic SL plugin is just a 5MB download then it really isn't surprising that swathes of what is in WPF is missing. Its also worth bearing in mind the Silverlight targets the Mac as well as Windows.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜