Loading File Variations Automatically
Fortunately, for Windows Store and universal apps, Windows exposes a simple yet powerful built-in scheme for handling automatic scaling for any image file packaged in your app. You can provide three separate variations, one for each possible scale. If you follow one of two naming conventions, then the Image
element automatically uses the correct one for the current environment.
For example, if you set an Image
’s Source
to Assets/photo.jpg
, then you can name the three variations of this file as follows to take advantage of this automatic support:
Assets/photo
.scale-100.jpg
Assets/photo
.scale-140.jpg
Assets/photo ...
Get XAML Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.