Search code examples
c#.netsilverlightexpression-blend

Icons in Silverlight: Images vs. Vectors


I like using the vector drawing feature of Expression Blend to create icons. That way I can change colors easily on my icons without having to resort to an image editor.

But my question is... Say I have a treeview control that has an icon next to each tree element and say I have hundreds of elements. Do you think using images is faster - performance wise than using vector icons? B/c I'd rather use vectors but I'm wondering about performance concerns.


Solution

  • Whenever you produce vector graphics that are static, use CacheMode to at least reduce the level of math needed to handle the said graphics (given Silverlight doesn't use GPU and relies on software rendering to perform tasks like this).

    That being said, go for the Bitmap approach as much as you can as it's less tax on the CPU but obviously more tax in download - balancing act :(

    A good article on this can be found here:


    http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2009/04/16/silverlight-3-and-gpu-acceleration.aspx


    Scott Barnes

    (Former Silverlight Product Manager)