Zen of WP8 Multi-resolution support、APIs for WP8 multi-resolution、DevCenter multiple XAP support、およびWP7 & WP8 co-development guideというトピックに関する以前の回答をお読みください。
具体的には、ランタイム適応の下にある WP7 & WP8 共同開発ガイドをご覧ください。次のコード スニペットがあります。
public Uri GetScaledImageUri(String imageName)
{
int scaleFactor = (int)Application.Current.Host.Content.ScaleFactor;
switch (scaleFactor)
{
case 100: return new Uri(imageName + "_wvga.png", UriKind.RelativeOrAbsolute);
case 150: return new Uri(imageName + "_720p.png", UriKind.RelativeOrAbsolute);
case 160: return new Uri(imageName + "_wxga.png", UriKind.RelativeOrAbsolute);
default: throw new InvalidOperationException("Unknown resolution type");
}
}
// Next line will load a correct image depending on the resolution of the device
MyImage.Source = new BitmapImage(GetScaledImageUri("myImage"));
また、次の 3 つの相互に排他的なコード スニペットを持つWP8 マルチ解像度の API もご覧ください。
Image myImage = new Image();
if (MultiRes.Is720p)
myImage.Source = new BitmapImage(new Uri("puppies.720p.jpg"));
else if (MultiRes.IsWvga)
myImage.Source = new BitmapImage(new Uri("puppies.wvga.jpg"));
else if (MultiRes.IsWxga)
myImage.Source = new BitmapImage(new Uri("puppies.wxga.jpg"));
if (MultiRes.Is720p)
myImage.Source = new BitmapImage(new Uri(@"assets\16by9AspectRatio\puppies.jpg"));
else
myImage.Source = new BitmapImage(new Uri(@"assets\15by9AspectRatio\puppies.jpg"));
if (MultiRes.IsHighResolution)
myImage.Source = new BitmapImage(new Uri(@"assets\HD\puppies.jpg"));
else
myImage.Source = new BitmapImage(new Uri(@"assets\SD\puppies.jpg"));