int NewWidth = 100;
int NewHeight = 74;
StreamReader sr = new StreamReader(HttpContext.Current.Server.MapPath(path) + guid + "." + fileName.Split('.')[fileName.Split('.').Length - 1]);
System.Drawing.Bitmap bmpOut = new System.Drawing.Bitmap(NewWidth, NewHeight);
System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmpOut);
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
g.FillRectangle(System.Drawing.Brushes.White, 0, 0, NewWidth, NewHeight);
g.DrawImage(new System.Drawing.Bitmap(sr.BaseStream), 0, 0, NewWidth, NewHeight);
MemoryStream stream = new MemoryStream();
bmpOut.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
String saveImagePath = path + guid + "_thumbnail.jpg";
bmpOut.Save(HttpContext.Current.Server.MapPath(saveImagePath), System.Drawing.Imaging.ImageFormat.Jpeg);
g.Dispose();
bmpOut.Dispose();
sr.Dispose();
image geneation