我有 c# 代码来裁剪图像。
当我裁剪图像(大小:191 KB,使用我的 c# 代码)时,结果(裁剪)图像的大小会增加(大小:2.44 MB)
请告诉我为什么裁剪后尺寸会增加..???
Bitmap source = new Bitmap(@"F:\images\Row" + i + "Col" + j + ".jpg");
Rectangle section = new Rectangle(new Point(0, 0), new Size(1362, 761));
Bitmap CroppedImage = CropImage(source, section);
CroppedImage.Save(@"file path\Row" + i + "Col" + j + ".jpg");
public Bitmap CropImage(Bitmap source, Rectangle section)
{
// An empty bitmap which will hold the cropped image
Bitmap bmp = new Bitmap(section.Width, section.Height);
Graphics g = Graphics.FromImage(bmp);
// Draw the given area (section) of the source image
// at location 0,0 on the empty bitmap (bmp)
g.DrawImage(source, 0, 0, section, GraphicsUnit.Pixel);
return bmp;
}