This project is read-only.
Project Description
Asp.NET server control that takes a image as input, and outputs its thumbnail. Its based on the asp:Image control.

Register e.g. in web config:
<pages>
<controls>
<add tagPrefix="bdn" assembly="BDN.ServerControls" namespace="BDN.ServerControls"/>
....
</controls>
</pages>


Usage:
<bdn:Thumbnail
ImageUrl="MyBigImage.jpg"
Height="100"
Width="150"
ThumbHeight="100"
ThumbWidth="150"
ThumbFolder="~/Uploads/Thumbs"
Log="True"
ErrorImage="~/Images/Spacer.gif"
runat="server"
ID="tb"
/>

Properties
ThumbHeight (required): Height of generated thumbnail
ThumbWidth(required): Width of generated thumbnail
ThumbFolder(required): Folder with write permissions, to store thumbnails.
ImageUrl (required): Url of source image
ErrorImage (required): If thumbnail generation failes, return this image
Log (true/false): Log errors to a file in thumb folder

  • In "2. release" only one of ThumbHeight and ThumbWidth are required

Assumptions
All thumbnails are stored in the thumbnail folder with the same name as the original image. If two images in your page have the same name, you will get some funny results.

Blog: http://www.superbia.no

Last edited Mar 2, 2008 at 3:54 PM by BjartN, version 7