
比如每个数代表什么意思,哪个位置的数字表示图像的长和宽等
================
你试一下是否符合你的要求
///
/// 载入灰度图
///
/// 目标 PictureBox 对象
/// 字节数组
/// 图片宽度
/// 图片高度
void LoadPicture(PictureBox pb,byte[] data,int width,int height)
{
Bitmap bmp = new Bitmap(width, height);
Graphics gp = Graphics.FromImage(bmp);
gp.Clear(Color.White);
int t = 0;
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++ ,t++)
{
if (t >= data.Length)
{
goto endfor;
}
byte c = data[t];
Color color = Color.FromArgb(c, c, c);
gp.FillRectangle(new SolidBrush(color), x, y, 1, 1);
}
}
endfor:
gp.Save();
pb.Image = bmp;
}