读取图片代码如下:
Image img = Image.FromFile(imgPath);
int width = img.Width;
int height = img.Height;
MemoryStream ms = new MemoryStream();
if (img.RawFormat.Guid == System.Drawing.Imaging.ImageFormat.Bmp.Guid)
img.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
byte[] fileBytes = ms.ToArray();
原图和读取后的图片如下:
图中,上面的1.bmp是读取出来的效果
下面的barcode.bmp是原始图片
很明显,1.bmp中的一些像素变成了灰色,
请问如果解决?