Last post Mar 19, 2006 02:58 AM by joteke
Mar 17, 2006 05:33 PM|knoppen|LINK
I am trying to resize an image and I've made a canvas to draw the image in, I will also draw there some copyright stuff and DrawString etc. later.
The problem is that all the images that I draw in the canvas, g.DrawImage etc. will be in s**t quality, REALLY bad quality!
I want to make all the images that I draw in the canvas top quality. How do I achive this? The code is below.
Thanks in advance!
System.Drawing.Image image = System.Drawing.Image.FromFile("C:\\Inetpub\\wwwroot\\test10.jpg");
System.Drawing.Image canvas = new Bitmap(205, 288, image.PixelFormat);
Graphics g = Graphics.FromImage(canvas);
g.CompositingQuality = CompositingQuality.HighQuality;
g.SmoothingMode = SmoothingMode.HighQuality;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.DrawImage(image, 0, 0, 205, 288);
canvas.Save("C:\\Inetpub\\wwwroot\\" + Guid.NewGuid() + "_Dildo_Dildo_12345.jpg", ImageFormat.Jpeg);
Mar 19, 2006 02:58 AM|joteke|LINK
you probably need to take use of overload of Save method which lets you better control the quality & image codec.
Image.Save Method (String, ImageCodecInfo, EncoderParameters)