using Microsoft.Win32;
private void Button_Select_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog openfiledialog = new OpenFileDialog
{
Filter = "图像文件|*.jpg;*.png;*.jpeg;*.bmp;*.gif|所有文件|*.*"
};
if ((bool)openfiledialog.ShowDialog())
{
Image1.Source = new BitmapImage(new Uri(openfiledialog.FileName));
}
}
WPF 选择本地图片加载到Image控件
最新推荐文章于 2024-07-26 20:00:59 发布