I'm trying to resize an image wihout loosing quality. I use code from here
Bitmap newImage = new Bitmap(newWidth, newHeight);
using (Graphics gr = Graphics.FromImage(newImage))
{
gr.SmoothingMode = SmoothingMode.HighQuality;
gr.InterpolationMode = InterpolationMode.HighQualityBicubic;
gr.PixelOffsetMode = PixelOffsetMode.HighQuality;
gr.DrawImage(srcImage, new Rectangle(0, 0, newWidth, newHeight));
}
But I got strange problem: a 1px border around the image.
Not easy to see it, but when you zoom image you can note it, especially in the top-left corner.
How to get rid of it? What is the problem?
Thx!