在WPF使用图像控件来显示System.Drawing.Bitmap [英] Using Image control in WPF to display System.Drawing.Bitmap
本文介绍了在WPF使用图像控件来显示System.Drawing.Bitmap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何分配内存位图
对象的图像在WPF
控制?
How do I assign an in-memory Bitmap
object to an Image
control in WPF ?
推荐答案
您可以用图像的源属性。试试这个code ...
You can use the Source property of the image. Try this code...
ImageSource imageSource = new BitmapImage(new Uri("C:\\FileName.gif"));
image1.Source = imageSource;
这篇关于在WPF使用图像控件来显示System.Drawing.Bitmap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文