二进制打开图片,图片大小为30M jpg格式,内存不足
我已经将图片转为二进制,存入oracle 数据,现在想在picturebox中打开,打开报内存不足,图片大小为30M jpg格式,
系统为32位,内存4G
存入方式
File.ReadAllBytes ;
打开方式
byte[] mByte = mDT.Rows[0]["PictureFile"] as byte[];
MemoryStream mMemoryS = new MemoryStream(mByte);
Bitmap mBitmap = new Bitmap(mMemoryS);这个为报错位置
本来想压缩图片大小
public static Bitmap ResizeBitmap(Bitmap ExBitmap,int width,int height)
{
Bitmap mBitmap = new Bitmap(width, height);
Graphics mGraphics = Graphics.FromImage(mBitmap);
mGraphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
mGraphics.DrawImage(ExBitmap, new Rectangle(0, 0, width, height),
new Rectangle(0, 0, ExBitmap.Width, ExBitmap.Height), GraphicsUnit.Pixel);
mGraphics.Dispose();
return mBitmap;
}
但是现在压根就得不到 图片格式