Free! - Thumbnail and watermark images on the fly with ASP.NET

This is a very easy and effective way to display watermarked and thumbnailed images from a folder on your server. It is based on an original piece of code from 4 Guys at Rolla, with image quality interpolation and watermarking added.
Download the watermarked_thumbnail.aspx file and stick it on your server.
Change the strWatermark text to whatever text you want. This measures the text length for positioning in the image.
Change the lines below:
g.DrawString("DMXZone", wmFont, shadowBrush, 75, (imageHeight * .5) - 36) g.DrawString("DMXZone", wmFont, letterBrush, 77, (imageHeight * .5) - 38)
Put your desired text (same as strWatermark text) fordrawing the watermark. Use the co-ordinates to finely adjust the text position if required.
On the page you want to display the thumbnailed image, call the image from the watermarked_thumbnail.aspx file like this:
<img src="watermarked_thumbnail.aspx?img=<%=(ImageRecordset.Fields.Item("IMAGE NAME").Value)%>") />
Where the IMAGE NAME is yourimage.jpg (this will only work for jpg files)
On the watermarked_thumbnail.aspx page, enter the desired image width (the height will be calculated automatically to preserve the image ratio) and the watermark text.
Enter the path to your images folder. If you are selling images from your site, put the images folder above the root and use a physical path e.g E:\domains\yoursite\MyImages\. The path to the folder will not be visible to the site visitor.
User Reviews
Total of 8 reviewsHelp
Written by Arlen Navasartian on March 11, 2009Where can i download watermarked_thumbnail.aspx ? i couldn't find where to download
Thumbnail Watermark on the Fly
Written by Ella Wei on November 4, 2007It worked perfectly fine with a .jpeg. But I don't know how to apply if I retrieve an image from database, for example, the image is retrieved by a handler like this, <img src='Handler.ashx?PhotoID=<%# Eval('PhotoID') %>&Size=L' /> ...
Works on localhost but not on MY .NET HOSTING
Written by Shahadat Hossen on August 2, 2007Hello this script does not work on my .net host. what do i do?
How can I save the image into hard disk?
Written by Shahadat Hossen on August 1, 2007How do I save the image in a folder of my site?
Thumbnails & Watermark images on the fly asp.net
Written by Patricia O'Neal on January 17, 2007Hello Everyone, I have just finished the tutorial above (http://www.dmxzone.com/showdetail.asp?NewsId=10287)and have an error that says: Name 'ImageRecordset' is not declared Can someone help. RegardsPati20005
recordset
Written by joe mr on April 27, 2006followed instructions but no go, 'ImageRecordset' is not declared...
about my previous question about ImageRecordset..
Written by Oliviero Dall'Asta on December 13, 2005Sorry, I've not realized immediately that yuo were retriving a record from a dataset or something like it...usually I'm working with Visual studio...
doesn't work..
Written by Oliviero Dall'Asta on December 13, 2005What is ImageRecordset in your code??









