即時通訊嘗試重新創建一個非常簡單的C#項目示例我WPF,它的一個簡單的圖像查看器..從薩姆教自己C#,我設法讓打開的文件對話框打開,但怎麼做我將圖像路徑設置爲WPF中的image.source控件?WPF圖像控制源
private void SearchBtn_Click(object sender, RoutedEventArgs e)
{
Microsoft.Win32.OpenFileDialog openfile = new Microsoft.Win32.OpenFileDialog();
openfile.DefaultExt = "*.jpg";
openfile.Filter = "Image Files|*.jpg";
Nullable<bool> result = openfile.ShowDialog();
if (result == true)
{
//imagebox.Source = openfile.FileName;
}
}
謝謝你,你當如何設置Sizemode.zoom propertie的形象呢? – Dabiddo 2009-08-08 04:04:20
也適合我!謝謝 – Azeem 2012-04-26 17:13:30
謝謝。爲我工作 – 2018-01-15 04:47:47