[英]Get ImageSource from Bitmap?
I want to set a background image for my form/window like this guy but instead of an image file on disk I've got a System.Drawing.Bitmap
in memory. 我想为我的表单/窗口设置一个背景图像, 就像这个人而不是磁盘上的图像文件我在内存中有一个
System.Drawing.Bitmap
。
I need to do something like this: 我需要做这样的事情:
this.Background = new ImageBrush(new BitmapImage(bmp));
Except BitmapImage
won't take a Bitmap
, nor will ImageBrush
and I'm not sure if any of the others will. 除了
BitmapImage
不会采用Bitmap
, ImageBrush
和我也不确定是否会有其他人。 There's one called BitmapCacheBrush
but I don't know what that does. 有一个名为
BitmapCacheBrush
但我不知道它是做什么的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.