//Reduse image with saving its proportion
Func<System.Drawing.Image, int, int, System.Drawing.Image> imgReduse = (System.Drawing.Image _img, int _width, int _height) => {
var _rx = (double)_img.Width/_width;
var _ry = (double)_img.Height/_height;
var _ratio = Math.Min(_rx, _ry);
var _newW = (int)(_img.Width/_ratio);
var _newH = (int)(_img.Height/_ratio);
return new System.Drawing.Bitmap(_img, _newW, _newH);
};
string imagePath = @"D:\downloads\photo_51465.jpg";
// Create image file
System.Drawing.Image tempimg = System.Drawing.Image.FromFile(imagePath);
System.Drawing.Image img = imgReduse(tempimg, 300, 100);
// Save new image
img.Save(@"D:\downloads\small_photo_51465.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
tempimg.Dispose();
img.Dispose();