请牛人帮忙看一下代码哪里错了
rgbBitmap是装载bmp图像数据部分的内容,此程序的目的是想把内存中的图像数据在pictureBox中显示。但是不知道为什么总是在倒数第二行出现一个这样的异常:
未处理的“System.ArgumentException”类型的异常出现在 system.drawing.dll 中。
其他信息: 使用了无效参数。
Image *myImage;
MemoryStream *myStream;
myStream=new MemoryStream;
BinaryWriter *myWriter;
myWriter=new BinaryWriter(myStream);
myWriter->Write(bfType);
myWriter->Write(bfsize);
myWriter->Write(bfReserved1);
myWriter->Write(bfReserved2);
myWriter->Write(bfOffBits);
myWriter->Write(bmpHdr.biBitCount);
myWriter->Writ(bmpHdr.biClrImportant);
myWriter->Write(bmpHdr.biClrUsed);
myWriter->Write(bmpHdr.biCompression);
myWriter->Write(bmpHdr.biHeight);
myWriter->Write(bmpHdr.biPlanes);
myWriter->Write(bmpHdr.biSize);
myWriter->Write(bmpHdr.biSizeImage);
myWriter->Write(bmpHdr.biWidth);
myWriter->Write(bmpHdr.biXPelsPerMeter);
myWriter->Write(bmpHdr.biYPelsPerMeter);
for(j=0;j<KWidth*KHeight*3;j++)
{
myWriter->Write(rgbBitmap[j]);
}
myImage= System::Drawing::Image::FromStream(myStream);
pictureBox1->Image=myImage;
小弟实在处理不了了,希望各位大哥大姐帮一下 --------------------编程问答-------------------- 学C++没这么深入 --------------------编程问答-------------------- myImage= System::Drawing::Image::FromStream(myStream);
查看一下参数签名格式 --------------------编程问答-------------------- --------------------编程问答-------------------- 这个简单啊,网上搜一下就得到答案了. --------------------编程问答-------------------- 以后需再关注,现在先帮你顶一下
补充:.NET技术 , .NET Framework