【发布时间】:2013-07-30 20:42:10
【问题描述】:
我的代码目前如下所示:
if (fe == "CR2")
{
Image img = null;
byte[] ba = File.ReadAllBytes(open.FileName);
using (Image raw = Image.FromStream(new MemoryStream(ba)))
{
img = raw;
}
Bitmap bm = new Bitmap(img);
pictureBox1.Image = bm;
statusl.Text = fe;
}
当我打开一个 RAW 图像时,程序停止并且 Visual Studio 说:
参数无效:Image raw = Image.FromStream(new MemoryStream(ba))
请帮忙!如何让 RAW 文件显示在 PictureBox 中?
【问题讨论】:
-
您得到的确切错误是什么?运行时错误,编译错误...
-
ba 是
byte[]而 MemoryStream 需要 ?嗯 -
GDI+ 不支持 RAW 格式。请参阅this question 了解建议的替代方法。