I am trying to do a very simple thing: get the image size.
So, I create my BitmapImage , but get 0 when I try to access PixelWidth and PixelHeight .
How can I do this please?
EDIT: (added sample code)
I just do:
var baseUri = new Uri("ms-appx:///"); var bitmapImage = new BitmapImage(new Uri(baseUri, "Assets/Logo.png")); MyImage.Source = bitmapImage; Debug.WriteLine("Width: " + bitmapImage.PixelWidth + " Height: " + bitmapImage.PixelHeight);
In the console, I get:
Width: 0 Height: 0
source share