T
tshad
I have a class I created to resize images in my program.
It seems to work pretty good with JPGs and GIFs. Pngs look pretty good
until you try to expand them, such as in Micorsoft Office Picture Manager by
holding down the ctrl key and rolling your mouse wheel. It expands fine and
you can see the picture but not the detail. The letters start to blur. If
you do the same thing with the original PNG file, it looks great as you
increase it.
How can I handle compression with a PNG file?
Here is my code:
***************************************************************
public static Image GetImageResize(Image oImage, int width)
{
int imageHeight;
int imageWidth;
float imageRatio;
// string s = System.Text.Encoding.ASCII.GetString(arrBytes);
imageRatio = (float)oImage.Height / (float)oImage.Width;
imageHeight = (int)(width * imageRatio);
imageWidth = width;
oImage = oImage.GetThumbnailImage(imageWidth, imageHeight, null,
IntPtr.Zero);
return oImage;
}
***************************************************************
Thanks,
Tom
It seems to work pretty good with JPGs and GIFs. Pngs look pretty good
until you try to expand them, such as in Micorsoft Office Picture Manager by
holding down the ctrl key and rolling your mouse wheel. It expands fine and
you can see the picture but not the detail. The letters start to blur. If
you do the same thing with the original PNG file, it looks great as you
increase it.
How can I handle compression with a PNG file?
Here is my code:
***************************************************************
public static Image GetImageResize(Image oImage, int width)
{
int imageHeight;
int imageWidth;
float imageRatio;
// string s = System.Text.Encoding.ASCII.GetString(arrBytes);
imageRatio = (float)oImage.Height / (float)oImage.Width;
imageHeight = (int)(width * imageRatio);
imageWidth = width;
oImage = oImage.GetThumbnailImage(imageWidth, imageHeight, null,
IntPtr.Zero);
return oImage;
}
***************************************************************
Thanks,
Tom