Free Support Forum - aspose.com

Compress image size

Thank you very much!
I am now work tasks every Files converting Image or PDF for Aspose, So there are a lot of problems please teach you , I hope you will continue to help me .
Here there is a problem , I using MemoryStream converting PDF to Image , How to Compressed generate image size .but the resolution remains the same.
The code .
using (MemoryStream imageStream = new MemoryStream())
{
Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(300);
Aspose.Pdf.Devices.PngDevice pngDevice = new Aspose.Pdf.Devices.PngDevice(resolution);
pngDevice.Process(pdfDocument.Pages[1], imageStream);
imageStream.Position = 0;
Aspose.Pdf.Image img = new Aspose.Pdf.Image();
img.ImageStream = imageStream;
System.Drawing.Image gImage = Bitmap.FromStream(imageStream);

                int w = (int)pdfDocument.Pages[1].CropBox.Width;
                int h = (int)pdfDocument.Pages[1].CropBox.Height;

Bitmap image = new Bitmap(imageStream);
image.Save(SasName + pag + “.jpg”);
image.Dispose();

}

@Liangsb

Would you please share source and generated files with us so that we may investigate further to help you out.