If I open an image using this code I get the correct width and height:
Bitmap bitmap = new Bitmap(@"C:\Users\Javier Escribano\Desktop\sample.png");
var imageHeight = bitmap.Height; //1270
var imageWidth = bitmap.Width; //1650
but If I use this code to show an image on WPF control the image is automatically resized. I want to keep the original dimensions:
ImageSource img = (ImageSource)new ImageSourceConverter().ConvertFromString(
@"C:\Users\Javier Escribano\Desktop\sample.png");
this.image.Source = img;
this.image.Width = img.Height; //1057
this.image.Height = img.Width; // 817
img.PixelWidth
andimg.PixelHeight
.