imageControl.Source = this.GetBitmapImage(imagePath);//imageControl为WPF Image控件
public BitmapImage GetBitmapImage(string imagePath) { BitmapImage bitmap = new BitmapImage(); bitmap.BeginInit(); bitmap.CacheOption = BitmapCacheOption.OnLoad; bitmap.UriSource = new Uri(imagePath); bitmap.EndInit(); return bitmap.Clone(); }