views:

271

answers:

0

Hi

In the following code i want to get the pixelwidth but when i apply DecodePixelWidth because of memory performance i loose the original pixelwidth value. Thanks in advanced.

BitmapImage myBitmapImage = new BitmapImage();
myBitmapImage.BeginInit();
myBitmapImage.UriSource = new Uri(uri, UriKind.Absolute);
myBitmapImage.DecodePixelWidth = 87; myBitmapImage.EndInit();

ImageWidth = myBitmapImage.PixelWidth; ImageHeight = myBitmapImage.PixelHeight;