http://blogs.clariusconsulting.net/eze

Ezequiel Sculli

Go Back to
eze′s Latest post

How to: programmatically load an Image into an ImageBrush from an Uri on WinRT (Metro apps)

var bitmapImage = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri(“ms-appx:/Assets/Logo.png”));
Windows.UI.Xaml.Media.ImageBrush image = new Windows.UI.Xaml.Media.ImageBrush()
{
    ImageSource = bitmapImage
};
Comments

4 Comments

  1. Thanks for your help, but how can I now change the Source of my Image?

  2. Great, I was thinking of using ../, with relative path, but it is more similar to Windows pone ms-appx: was the point. Thanks

  3. Thank you!! You save me. I would never have thought of using “ms-appx:”