Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Resizing an image
Message
From
14/05/2008 12:24:10
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01316868
Message ID:
01317040
Views:
10
>Something like this would work (you'll obviously want to verify the image types, add some error/exception handling). I'm also assuming you're using the FileUpload control. This code could go in the Click event of your "Upload" button.
>
>
>System.Drawing.Image img = System.Drawing.Image.FromStream(this.FileUpload1.PostedFile.InputStream);
>System.Drawing.Image thumb = img.GetThumbnailImage(100, 100, null, IntPtr.Zero);
>thumb.Save(@"C:\Sample.jpg");
>
Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform