讀取圖片代碼如下:
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中的一些像素變成了灰色,
請問如果解決?
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/262293.html
標籤:組件/控件開發
