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

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

Cervisiae Amatorem
Posts: 57
Joined: Mon Aug 29, 2011 5:47 pm UTC

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

Postby Cervisiae Amatorem » Wed Dec 04, 2013 1:21 am UTC

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

User avatar
Xanthir
My HERO!!!
Posts: 5339
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

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

Postby Xanthir » Wed Dec 04, 2013 2:55 am UTC

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.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

Cervisiae Amatorem
Posts: 57
Joined: Mon Aug 29, 2011 5:47 pm UTC

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

Postby Cervisiae Amatorem » Wed Dec 04, 2013 9:16 am UTC

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.

User avatar
Cleverbeans
Posts: 1378
Joined: Wed Mar 26, 2008 1:16 pm UTC

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

Postby Cleverbeans » Wed Dec 04, 2013 4:01 pm UTC

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.
"Labor is prior to, and independent of, capital. Capital is only the fruit of labor, and could never have existed if labor had not first existed. Labor is the superior of capital, and deserves much the higher consideration." - Abraham Lincoln

Cervisiae Amatorem
Posts: 57
Joined: Mon Aug 29, 2011 5:47 pm UTC

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

Postby Cervisiae Amatorem » Wed Dec 04, 2013 8:57 pm UTC

Thanks guys, I got it working!


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 9 guests