这是我将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");
}
}
Run Code Online (Sandbox Code Playgroud)
我得到了这个:
alt text http:////img11.imageshack.us/img11/4853/testacr.png
代码中的问题在哪里,为什么会发生这种情况?如何将其恢复正常?
| 归档时间: |
|
| 查看次数: |
2065 次 |
| 最近记录: |