We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Shrink size of image


I use the ToImage() function of a chart and save it as bmp.save(). It makes very big files (600 KB) for small images.

Can i shrink it in size without losing too much quality? If so, how do i do that in code?

Kind regards,

Hi Karim,

Well, I think you should decrease the size of the designer chart in the excel file.

Thank you.

Hi Amjad,

Thanks for your swift replies.

Following works like a charm:

Bitmap bmp = chart.ToImage();

ImageCodecInfo ici = GetImageCodec("image/gif");

EncoderParameters eps = new EncoderParameters(1);

EncoderParameter encp = new EncoderParameter(Encoder.Quality, 40);

eps.Param.SetValue(encp, 0);

//, ici, eps

bmp.Save("test.gif", ici, eps);

Kind regards,