locked
Best practice for vector art / icons in WPF / Blend? RRS feed

  • Question

  • What is the best practice for iconography in the WPF world?  As far as I can tell there are two distinct methods, or perhaps a combination of both:

    1. Create PNG graphic files and store in an associated images folder.  These files could be created from anything--vector or bitmap images. Ultimately they are lossless as-is fixed sized images.  Relatively lightweight depending on size.

    2. Create a resource dictionary full of drawing brushes with vector artwork.  These are fully scalable images, editable on the spot in blend's UI, and have elements that can be copied and used elsewhere in Blend.

    My obvious preference is no. 2...but I'm not sure how the WPF engine bears under using rich drawing brushes.  Ultimately, what is the hit on performance?

    Any insight would be appreciated.

    Purkiss
    Thursday, February 18, 2010 2:54 PM

Answers

  • Howdy,

    I dont have any specific data on performance for you sorry, but as a general rule if you are concerned about it to the degree because you have a ton of ICONS/IMAGES in your app etc, then I tend to use PNG's for all purposes where the element will never be scaled or animated. If it does need to be animated and or scaled, I import the vector, ensure it is inside a canvas and then inside a viewbox.

    Hope that helps.

    Cheers

    Expression MVP

    my blog : http://x-coders.com/blogs/sneaky/default.aspx

    Thursday, February 18, 2010 10:12 PM
    Moderator

All replies

  • Howdy,

    I dont have any specific data on performance for you sorry, but as a general rule if you are concerned about it to the degree because you have a ton of ICONS/IMAGES in your app etc, then I tend to use PNG's for all purposes where the element will never be scaled or animated. If it does need to be animated and or scaled, I import the vector, ensure it is inside a canvas and then inside a viewbox.

    Hope that helps.

    Cheers

    Expression MVP

    my blog : http://x-coders.com/blogs/sneaky/default.aspx

    Thursday, February 18, 2010 10:12 PM
    Moderator
  • Hi Brennon,

    That does help, and makes sense.  I also like the ability to edit XAML icons right in Blend, giving the ability to create new ones on-the-fly without leaving the context of the Blend design environment.  As a result, I have been leaning on XAML icons almost exclusively unless I only have a bitmap version that isn't worth tracing into XAML. 

    Thank you for your input.


    Purkiss
    Tuesday, July 13, 2010 8:39 PM