C# 将大图像加载到图像控件中
我在WPF窗口上加载大图像以进行一些调整(如亮度和对比度),但当我尝试加载大图像(3000x2000或4000x3000)时,我的图像会自动转换为较低的分辨率(通常为1024x600)C# 将大图像加载到图像控件中,c#,wpf,bitmapimage,C#,Wpf,Bitmapimage,我在WPF窗口上加载大图像以进行一些调整(如亮度和对比度),但当我尝试加载大图像(3000x2000或4000x3000)时,我的图像会自动转换为较低的分辨率(通常为1024x600) 如何在BitmapImage对象中保持图像的原始分辨率?听起来很奇怪。尝试直接在XAML中设置myImage.Source 控件应保留原始图像 <Image x:Name="image1" Stretch="None" Source={Binding PathToImage}> 尝试改用对象: M
如何在BitmapImage对象中保持图像的原始分辨率?听起来很奇怪。尝试直接在XAML中设置myImage.Source 控件应保留原始图像
<Image x:Name="image1" Stretch="None" Source={Binding PathToImage}>
尝试改用对象:
Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog();
openFileDialog.ShowDialog();
ImageSource imageSource = new BitmapImage(new Uri(openFileDialog.FileName));
image1.Source = imageSource;
您可以发布
myImage
控件及其容器的XAML吗?
Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog();
openFileDialog.ShowDialog();
ImageSource imageSource = new BitmapImage(new Uri(openFileDialog.FileName));
image1.Source = imageSource;