如何将位图转换为图像

时间:2012-02-20 19:34:54

标签: c# winforms gdi+

我正在制作中值滤波器,问题是只能在Bitmap中操纵像素。稍后我想在使用PictureBox的{​​{1}}中显示结果。我无法找到解决这个问题的方法......我唯一能想到的就是使用Image,但不知道怎么做。帮助将被评估〜

Stream

3 个答案:

答案 0 :(得分:58)

BitmapImage。它继承自Image类。

From MSDN

[SerializableAttribute]
[ComVisibleAttribute(true)]
public sealed class Bitmap : Image

答案 1 :(得分:0)

检查名称空间。 System.Drawing.Image与位图兼容,System.Window.Control.Image-不兼容!

答案 2 :(得分:0)

这对我有用:

var codeBitmap = new Bitmap(your_info);
Image image = (Image)codeBitmap;