Aurigma Image Uploader 6.5 Dual
A watermark is a text or an image which is printed upon the image, and provides a simple means of adding useful information like date and time or the name of the image author or some logo. With Image Uploader you can easily add watermarks to thumbnails of images you upload, and each of the thumbnails can have its own watermark.
There are two ways to add watermarks: using the initialization parameter or setting the corresponding property of Image Uploader object itself in runtime. The following example demonstrates how to use both approaches to put a logo on all the first and second thumbnails. Note that the overlaying image is drawn semi-transparent. Here is the logo:
And here is the code:
If both thumbnails have the size of 320 x 240 pixels, we will get the following result:
As you see, the UploadThumbnail1Watermark and UploadThumbnail2Watermark properties specify a watermark as a string, which consists of several parameters separated by semicolons. The order and case of parameters are ignored.
In our example, the following parameters are used:
- ImageUrl - sets the logo.
- Position - sets the logo position (in our case, the top right corner of the image).
- ImageWidth and ImageHeight - set the logo size (in pixels).
- Opacity - sets the opacity of the logo.
There are other parameters, and their descriptions may be found in the reference.
You may also add watermarks to specific thumbnails using the UploadThumbnailWatermark property.
As you may see, applying watermarks is rather easy. However, you should remember some things about this process:
- You can use as watermarks images in any format supported by Image Uploader.
- The image watermarks are resized in the same manner as thumbnails, that is they can only be downsized (if it is needed).
- You may specify opacity for both text and image watermarks.
- You may specify a background color for both text and image watermarks. For the image watermarks it will be used, if the image contains transparency.
- When both text and image watermarks are specified, the text is always drawn over the image watermark.
- Position of the text and image watermarks is calculated separately.
If you need to add watermarks to original images, you can use the ActualSize fit mode for one of thumbnails and turn off original file upload. In order to do that, add the following parameters when initializing Image Uploader:
- UploadThumbnailWatermark Property
- UploadThumbnail1Watermark Property
- UploadThumbnail2Watermark Property
- UploadThumbnail3Watermark Property
- UploadThumbnail1FitMode Property
- UploadThumbnail2FitMode Property
- UploadThumbnail3FitMode Property
- UploadSourceFile Property
- UploadThumbnailAdd() Method
- BeforeUpload Event