Page 1 of 1

WP8 Inline Vector Image ..? (I don't know the words)

Posted: Wed Dec 04, 2013 1:21 am UTC
by Cervisiae Amatorem
Well I have been tasked with maintenance of a new Windows Phone 8 app, and I need to add a little image. The way it has been coded in the DataTemplates.xaml file, one image is defined like this:

Code: Select all

    <DataTemplate x:Key="namehere">
        <Path Width="19"
              Height="19"
              Data="M45.799513,25.590023C46.189226,25.590023,46.508989,25.909065,46.508989,26.297899L46.508989,27.883139C46.508989,28.271971 46.189226,28.591013 45.799513,28.591013 45.4098,28.591013 45.090033,28.271971 this goes on and on to the tune of 4k worth of these weird numbers"
              Fill="{StaticResource PhoneForegroundBrush}"
              Stretch="Uniform" />
    </DataTemplate>


That's some kind of vector art definition, because when I scale the dimensions the edges of the icon it defines stay nice and clean. The only problem is I have no idea what it's called, so I can't search to figure out how it works or how to make another one. Can anyone offer some insight? TIA

Re: WP8 Inline Vector Image ..? (I don't know the words)

Posted: Wed Dec 04, 2013 2:55 am UTC
by Xanthir
Some googling around shows good results when you search for "xaml vector graphics". I found several useful blog posts and SO articles that should help you out with any maintenance or editing.

Re: WP8 Inline Vector Image ..? (I don't know the words)

Posted: Wed Dec 04, 2013 9:16 am UTC
by Cervisiae Amatorem
Thanks Xanthir. egads, the guys who came before me didn't make it easy did they? I can't find any reason to use this style over a standard image file.

Re: WP8 Inline Vector Image ..? (I don't know the words)

Posted: Wed Dec 04, 2013 4:01 pm UTC
by Cleverbeans
Cervisiae Amatorem wrote:Thanks Xanthir. egads, the guys who came before me didn't make it easy did they? I can't find any reason to use this style over a standard image file.

You mean instead of using a raster image? You already mentioned it - vector graphics are scalable, rasters are not. If you're going to be using a graphic over and over again at different sizes a vector image is often prefered for this reason. If the graphic is originally drawn on a computer it's often done in a vector format and it would make sense to leave it in that format rather than convert it to a raster and lose the scalability even if it's not required.

Re: WP8 Inline Vector Image ..? (I don't know the words)

Posted: Wed Dec 04, 2013 8:57 pm UTC
by Cervisiae Amatorem
Thanks guys, I got it working!