我正在尝试将 BitmapImage 保存在应用程序文件夹路径中。我正在使用以下代码
OpenFileDialog fileDialog = new OpenFileDialog();
fileDialog.Filter = "JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif";
var resultSaveDialog = fileDialog.ShowDialog();
if (fileDialog.FileName != "" && resultSaveDialog == System.Windows.Forms.DialogResult.OK)
{
fileDialog.OpenFile();
strPath = fileDialog.FileName;
System.Windows.Media.Imaging.BitmapImage myBitmapImage = new System.Windows.Media.Imaging.BitmapImage();
myBitmapImage.BeginInit();
myBitmapImage.DecodePixelHeight = 20;
myBitmapImage.DecodePixelWidth = 20;
myBitmapImage.UriSource = new Uri(strPath, UriKind.Absolute);
myBitmapImage.EndInit();
System.Windows.Media.ImageSource imgSource = myBitmapImage;
}
我想将此保存myBitmapImage
到应用程序文件夹 LA_Img。我该怎么做..我找不到任何方法..