Office web components are great components to work with charts and another images. The previous live sample, captcha asp project generates text for human-testing forms, preventing automated submitions.
Simple ASP image resize functionThis sample uses Chart object from OWC library to resize any image and convert the image to a specified format (.jpg, .png, .bmp, .gif...). The image is placed to the chart using SetTextured property, which can load any image file from a disk. Then you can use border property to set some frame around the image (or left the frame blank) and export the picture using ExportPicture method to a disk or get the picture as a binary data for BinaryWrite using GetPicture method.
You can see this short code with Huge ASP file upload live at Upload with resize page.
Upload and image resize sample
Next piece of VBScript code if from the live resize sample and demonstrates the ResizeImage function. The source gif, jpeg or png image from upload is saved to a temp folder. The code reads data for the resize - new width and height and out format and then calls response.binarywrite ResizeImage().
for 'ASP image resize and jpg/gif/png convert, free VBScript code' article
Copyright and use this code
The source code on this page and other samples at http://www.motobit.com/tips/ are a free code, you can use it as you want: copy it, modify it, use it in your products, ...
If you use this code, please:
1. Leave the author note in the source.
2. Link this sample from you page.
<A Href="http://www.motobit.com/tips/detpg_asp-resize-image/" Title="Short sample of using Office web components to resize and convert image to another format" >ASP image resize and jpg/gif/png convert, free VBScript code</A>
© 1996 - 2014 Antonin Foller, Motobit Software | About, Contacts | (Find us on Google+)