问题描述
rgbBitmap是装载bmp图像数据部分的内容,此程序的目的是想把内存中的图像数据在pictureBox中显示。但是不知道为什么总是在倒数第二行出现一个这样的异常:未处理的“System.ArgumentException”类型的异常出现在system.drawing.dll中。其他信息:使用了无效参数。Image*myImage;MemoryStream*myStream;myStream=newMemoryStream;BinaryWriter*myWriter;myWriter=newBinaryWriter(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;小弟实在处理不了了,希望各位大哥大姐帮一下
解决方案
解决方案二:
?Writer还是Reader?
解决方案三:
接分先!
解决方案四:
等待牛人来答.