0

I'm loading large images on a WPF window to make some adjustments (like brightness and contrast) but when I try to load a large image (3000x2000 or 4000x3000) my image converts automatically to a lower resolution (usually 1024x600)

Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog();
openFileDialog.ShowDialog();

BitmapImage bitmap = new BitmapImage(new Uri(openFileDialog.FileName));

imageResolution.Content = bitmap.Width + "x" + bitmap.Height;//label to see dimensions
myImage.Source = bitmap;//image

What can I do to keep the original resolution of my images in the BitmapImage object?

Daniel
  • 10,864
  • 22
  • 84
  • 115
user962284
  • 670
  • 1
  • 12
  • 29

2 Answers2

0

Sounds strange. Try to set myImage.Source directly in XAML.

Control should keep original image

<Image x:Name="image1" Stretch="None" Source={Binding PathToImage}>
Ievgen
  • 4,261
  • 7
  • 75
  • 124
0

Try using an ImageSource object instead:

Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog();
openFileDialog.ShowDialog();
ImageSource imageSource = new BitmapImage(new Uri(openFileDialog.FileName));
image1.Source = imageSource;
Daniel
  • 10,864
  • 22
  • 84
  • 115