I have image file which is 6k jpg file with width: 172px and hight: 172px.
I use the following code try to resize it to 128*128px jpg file:
public static Image ResizeImage(Image img, int width, int height)
{
var b = new Bitmap(width, height, PixelFormat.Format24bppRgb);
using (Graphics g = Graphics.FromImage(b))
{
g.DrawImage(img, 0, 0, width, height);
}
return b;
}
This code has strangely increased the file size to 50k, can any one explain why? and how to resize the image to 128*128px and keep the size about 6k.
Many thanks.
DY