如何在 Windows Phone 8 上将 png 项目文件加载到图像中?

How to load png project file into an image on Windows Phone 8?

如何在 Windows Phone 8 或 8.1 上将 png 项目文件加载到图像中?

让 XAML 文件中有一个 Image,例如:

        <Image Name="img"/>

现在,从代码文件中的资产分配其 source,如:

        img.Source = new BitmapImage { UriSource = new Uri("/Assets/text1.png", UriKind.Relative) };

就是这样。