Commit aa6d1b50 authored by DailyShana's avatar DailyShana

fix

parent 4b1db6ea
...@@ -48,7 +48,6 @@ public static Bitmap Zoom(Bitmap sourceBitmap, int newWidth, int newHeight) ...@@ -48,7 +48,6 @@ public static Bitmap Zoom(Bitmap sourceBitmap, int newWidth, int newHeight)
Rectangle srcRect = new Rectangle(0, 0, sourceBitmap.Width, sourceBitmap.Height); Rectangle srcRect = new Rectangle(0, 0, sourceBitmap.Width, sourceBitmap.Height);
graphics.DrawImage(sourceBitmap, newRect, srcRect, GraphicsUnit.Pixel); graphics.DrawImage(sourceBitmap, newRect, srcRect, GraphicsUnit.Pixel);
graphics.Dispose(); graphics.Dispose();
sourceBitmap.Dispose();
return b; return b;
} }
return sourceBitmap; return sourceBitmap;
...@@ -105,7 +104,6 @@ public static Bitmap Cut(Bitmap sourceBitmap, int StartX, int StartY, int cutWid ...@@ -105,7 +104,6 @@ public static Bitmap Cut(Bitmap sourceBitmap, int StartX, int StartY, int cutWid
Rectangle srcRect = new Rectangle(StartX, StartY, cutWidth, cutHeight); Rectangle srcRect = new Rectangle(StartX, StartY, cutWidth, cutHeight);
graphics.DrawImage(sourceBitmap, cutRect, srcRect, GraphicsUnit.Pixel); graphics.DrawImage(sourceBitmap, cutRect, srcRect, GraphicsUnit.Pixel);
graphics.Dispose(); graphics.Dispose();
sourceBitmap.Dispose();
return bitmap; return bitmap;
} }
return sourceBitmap; return sourceBitmap;
......
...@@ -124,6 +124,7 @@ public void ToImg(string img, string saveimg1, string saveimg2) ...@@ -124,6 +124,7 @@ public void ToImg(string img, string saveimg1, string saveimg2)
saveimg1, imgSet.quilty); saveimg1, imgSet.quilty);
MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.w, imgSet.h), MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.w, imgSet.h),
saveimg2, imgSet.quilty); saveimg2, imgSet.quilty);
bmp.Dispose();
} }
#endregion #endregion
...@@ -193,6 +194,7 @@ public void CutImages(string imgpath, bool isreplace) ...@@ -193,6 +194,7 @@ public void CutImages(string imgpath, bool isreplace)
{ {
bmp = MyBitmap.Cut(bp, imgSet.normalArea); bmp = MyBitmap.Cut(bp, imgSet.normalArea);
} }
bp.Dispose();
MyBitmap.SaveAsJPEG(bmp, savejpg, imgSet.quilty); MyBitmap.SaveAsJPEG(bmp, savejpg, imgSet.quilty);
//bmp.Save(savejpg, ImageFormat.Png); //bmp.Save(savejpg, ImageFormat.Png);
} }
......
No preview for this file type
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment