【发布时间】:2010-10-19 02:04:57
【问题描述】:
这是我将 byte[] 数组转换为图像的代码
unsafe
{
//convert the UInt32[] into byte array and then assign the pointer to it
fixed (byte* ptr = Misc.ConvertFromUInt32Array(image))
{
Bitmap bmp = new Bitmap(200,64,800,
PixelFormat.Format32bppRgb,
new IntPtr(ptr));
bmp.Save("test.bmp");
}
}
我明白了:
alt text http:////img11.imageshack.us/img11/4853/testacr.png
代码中的问题在哪里,为什么会这样?怎样才能恢复正常?
【问题讨论】:
-
你只能有一张图片...如果必须选择,请显示反向的。
-
Misc.ConvertFromUInt32Array(image) 内部发生了什么?难道问题不是在那里发生而不是保存图像的一点点代码?