裁剪后的输出图像大于原始大小 [英] The output image after cropping is larger than the original size
本文介绍了裁剪后的输出图像大于原始大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用Bitmap.Clone()裁剪图像时,它会创建大于原始图像大小的输出
原始大小为:5 M
和输出裁剪图像是:28 M
如何在不丢失质量和没有大尺寸的情况下进行裁剪?
我的代码是:
when I crop an Image using Bitmap.Clone() it creates output larger than the Original Image Size
The Original size is : 5 M
and the Output Cropped image is : 28 M
how can I make cropping without lose quality and with no large size ?
my code is :
private static Image cropImage(Image img, Rectangle cropArea)
{
var bmpImage = new Bitmap(img);
Bitmap bmpCrop = bmpImage.Clone(cropArea, bmpImage.PixelFormat);
img.Dispose();
bmpCrop.Save(@"D:\Work\CropImage\CropImage\crop.bmp",bmpImage.RawFormat );
return (Image)(bmpCrop);
}
推荐答案
读完这个,你的答案就在那里。
裁剪图像 [ ^ ]
Read over this, your answer is in there.
Cropping Images[^]
白痴,因为您将其保存为位图
Idiot because you are saving it as a bitmap
这篇关于裁剪后的输出图像大于原始大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文