views:

144

answers:

2

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.

+1  A: 

Yes it's probably faster to have little bitmap icons. But it's also probably negligibly faster. WPF itself uses little vectors for things like the + and - in tree views if you break down the templates. It's designed to handle things like this. I also prefer to use the vector icons.

The only other trouble you'll probably encounter is "fuzziness", that's just the nature of vector graphics but with icons it's possible to explicitly draw every pixel and get them exactly right and thus be a bit less fuzzy. The downside is, of course, if you need it to be displayed at any other size it looks much much worse.

Just have to weigh the trade-offs.

justin.m.chase
+1  A: 

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)

Scott Barnes