for (myBitmap.col = 0; myBitmap.col < myBitmap.Height; myBitmap.col++)
{
for (myBitmap.row = 0; myBitmap.row < myBitmap.Height; myBitmap.row++)
{
myBitmap.data[myBitmap.row * (int)myBitmap.ScanLineWidth + myBitmap.col + myBitmap.offset] += 5;
}
}
MemoryStream ms = new MemoryStream(myBitmap.data);
pictureBox1.Image = Image.FromStream(ms);
//pictureBox1.Image = new Bitmap(returnimage);
MessageBox.Show("The image brightness conversion is successful");
我遇到将内存流对象转换为图片的问题。错误来自无效参数
答案 0 :(得分:1)
在创建图像之前尝试重新设置流指针:
ms.Seek( 0, SeekOrigin.Begin );