Creating Thumbnail Images On The Fly
How to create thumbnail image on the fly and keep the aspect ratio :
Dim imgsource As System.Drawing.Image = _
System.Drawing.Image. _
FromFile(Server.MapPath _
("~/images/") & ximg)
Dim img As System.Drawing.Image
img = New System.Drawing.Bitmap(imgsource, _
(100 * (imgsource.Width / _
imgsource.Height)), 100)
img.Save(Server.MapPath("~/images/") & _
"thumb" & ximg, _
System.Drawing.Imaging. _
ImageFormat.Jpeg)
Put it after upload process of your image.
Note : ximg is your image file name