.NET Hore....

simple beginner .NET geek
See also: Other Geeks@INDC

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

Share this post: | | | |
Posted: Jun 01 2006, 11:00 PM by soetam | with no comments
Filed under:

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 
Are you human?:  


Enter the numbers above: