Here is my code:
using (Graphics graph = Graphics.FromImage(destImg))
{
graph.InterpolationMode = InterpolationMode.HighQualityBicubic;
graph.SmoothingMode = SmoothingMode.HighQuality;
Rectangle srcRect = new Rectangle(0, 0, srcWidth, srcHeight);
Rectangle destRect = new Rectangle(0, 0, destWidth, destHeight);
graph.DrawImage(srcImg, destRect, srcRect, GraphicsUnit.Pixel);
srcImg.Dispose();
}
It can generate a 210k image(360*270 pixel) from a 550k image(1024*768 pixel).
However ,I can generate a 20k image in photoshop. Certainly, it seen some sort of blurring. But you know that I’m living in China, many of my customers are being tormented with 0.5M bandwidth now. They will not like a 210k image, it’s too huge!
So, how can I do to generate high compression ratio image in .Net?
I think I would switch to JPEG and lessen the quality. That generates pretty small filesizes.
Here is an example of how to do that in C#
http://www.geekpedia.com/tutorial232_Reducing-JPEG-Picture-Quality-using-Csharp.html