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)
Rectangle srcRect = new Rectangle(0, 0, sourceBitmap.Width, sourceBitmap.Height);
graphics.DrawImage(sourceBitmap, newRect, srcRect, GraphicsUnit.Pixel);
graphics.Dispose();
sourceBitmap.Dispose();
return b;
}
return sourceBitmap;
......@@ -105,7 +104,6 @@ public static Bitmap Cut(Bitmap sourceBitmap, int StartX, int StartY, int cutWid
Rectangle srcRect = new Rectangle(StartX, StartY, cutWidth, cutHeight);
graphics.DrawImage(sourceBitmap, cutRect, srcRect, GraphicsUnit.Pixel);
graphics.Dispose();
sourceBitmap.Dispose();
return bitmap;
}
return sourceBitmap;
......
......@@ -124,6 +124,7 @@ public void ToImg(string img, string saveimg1, string saveimg2)
saveimg1, imgSet.quilty);
MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.w, imgSet.h),
saveimg2, imgSet.quilty);
bmp.Dispose();
}
#endregion
......@@ -193,6 +194,7 @@ public void CutImages(string imgpath, bool isreplace)
{
bmp = MyBitmap.Cut(bp, imgSet.normalArea);
}
bp.Dispose();
MyBitmap.SaveAsJPEG(bmp, savejpg, imgSet.quilty);
//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