David Hayes
David Hayes

Reputation: 7512

How does image scaling work in Windows Phone 8.1

I'm trying to work out how best to use the new scaling feature in Windows Phone Universal Apps I have an image in SVG format and I've created several different versions

I then have the following XAML ,this renders the image way too large on a 240% scale device

<Image Source="...."  />

If I use this (explicitly setting the size) it renders as I expect

<Image Width="100" Height="100" Source="...."  />

In this case am I actually getting the benefit of the higher resolution image? It certainly looks better subjectively.

Is the difference that XAML Pixels are talking about a different thing to the actual pixels in the image? i.e. XAML pixels are logical rather than physical if that makes sense?

Upvotes: 1

Views: 916

Answers (1)

yasen
yasen

Reputation: 3580

I think you can find the information that you need here.

Basically, what you said is correct: XAML pixels are logical. On different devices they are scaled differently, so that you always have 480 pixels wide. So if you set an image's width to be 100 pixels, on some devices it will be much more physical pixels (say 180). So, if you have an image that's 180 pixels wide it will look perfect.

Upvotes: 1

Related Questions