string file = files[i];
Image img = Image.FromFile(file);
int width = img.Width;
int height = img.Height;
if (width > height)
{
width = 800;
height = width * img.Height / img.Width;
}
else
{
height = 800;
width = height * img.Width / img.Height;
}
Bitmap bt = new Bitmap(width, height);
Graphics g = Graphics.FromImage(bt);
g.DrawImage(img, 0, 0, width, height);
//g.Save(
//Image small = img.GetThumbnailImage(width, height, null, IntPtr.Zero);
bt.Save(string.Format("{0}m{1}.jpg", topath, i.ToString("0000")), ImageFormat.Jpeg);
Image img = Image.FromFile(file);
int width = img.Width;
int height = img.Height;
if (width > height)
{
width = 800;
height = width * img.Height / img.Width;
}
else
{
height = 800;
width = height * img.Width / img.Height;
}
Bitmap bt = new Bitmap(width, height);
Graphics g = Graphics.FromImage(bt);
g.DrawImage(img, 0, 0, width, height);
//g.Save(
//Image small = img.GetThumbnailImage(width, height, null, IntPtr.Zero);
bt.Save(string.Format("{0}m{1}.jpg", topath, i.ToString("0000")), ImageFormat.Jpeg);