View Full Version : Auto resizing image from DB.

01-05-2004, 01:28 AM

How do I auto resize an image im taking from the database? Lets say my image is 500x200 and I want to make a perfect resize which comes out to 200x80.

How can this be done?

Thank You!

01-05-2004, 10:44 PM
You use a commercial COM+ component (like ASPJPEG (http://www.aspjpeg.com/)) to resize the image.


01-06-2004, 01:06 AM
Awesome! Thanks, too bad it costs $150 bucks... :(

Is there maybe a free one, or cheaper? I bet not tho, you probably would have posted it.

Thanks Anyway, I will definitly consider it.

01-06-2004, 02:01 AM
A decent web host should provide an image manipulation component as part of your hosting package - check to see if there is one you can use, and if not, why not! ;)

Roy Sinclair
01-06-2004, 03:28 PM
You can use .NET instead of ASP which has what you want built into it. If you've got .NET installed already you've got the software you need, if you haven't installed it yet, the price is right since it's a free download from MS.

Use the System.Drawing.Image namespace to load the image, resize it and then use System.IO.MemoryStream to convert it to a Base64 string which you can then write out to the browser with the appropriate headers.

That's the simplified basics, you can perform a Google search using those keywords above and find several examples which are easy to use and lots of tutorial help on exactly what is going on and how it's accomplished.

01-06-2004, 05:01 PM
Dang we need to go with .NET.

01-06-2004, 05:05 PM
I didn't mention ASP.Net simply because although it is without a doubt free and probably the best solution (since it allows your web apps to do anything that a native Windows application can, using all the system libraries) it involves learning a whole new platform and/or language, which I thought went beyond the scope of the question a little. :p

01-06-2004, 05:10 PM
Just had a quick search and found this image component, which should do the job! It's free for non-commercial use, and otherwise it's only $35...



01-07-2004, 01:16 AM
Great, thanks for all your help!