Yawar
Yawar

Reputation: 1943

Windows Phone 8.1 Font and Images for Multiple screen sizes

I am new to Windows Phone development, So my first question is :

  1. In android we use sp when setting font size so that it sized according to its phone settings and screen size. But in windows phone I am setting font size in just a number like fontsize="16", Will it adjust itself or I have to do something else for it.

  2. Just like that in android we have ldpi,mdpi,hdpi etc folders for multiple screen density images. In windows how can this be acheived? I have searched for this link but couldn't understand that article.

Upvotes: 2

Views: 399

Answers (1)

Peter Torr
Peter Torr

Reputation: 12019

You can just use a single value for font sizes (and any other "pixel" sizes in XAML) and the platform will do the right thing so that the item is the correct physical size (uses the appropriate number of raw device pixels). The multiplier used for this is RawPixelsPerViewPixel although you don't need to worry about that detail if all you're doing is using text and static graphics (it's useful for things like DX interop, or dynamically downloading images from the network).

For how to provide images of different sizes, look into this MSDN sample.

Upvotes: 2

Related Questions