Aurigma Image Uploader 6.5 Dual
ImageUploader.UploadThumbnailWatermark Property
Watermark for the specified thumbnail.
Syntax
Get/Set Value in Runtime
JavaScript
getImageUploader("ImageUploaderID").setUploadThumbnailWatermark(Index, value);
value = getImageUploader("ImageUploaderID").getUploadThumbnailWatermark(Index);Parameters
- Index
-
A positive integer that specifies an index of the upload thumbnail (one-based). It should not exceed UploadThumbnailCount. If extra upload thumbnails are required, use the UploadThumbnailAdd() method to add them.
Property Value
A string value that specifies watermark settings for the specified thumbnail. Watermark string syntax is described in the Remarks section.
If an empty string is specified, watermark will not be drawn on this thumbnail.
Remarks
Image Uploader can generate multiple thumbnails per one file sent to the server. To configure sizes of thumbnails and other parameters, you can manipulate a list of upload thumbnail settings. It can be done two ways:
- Use UploadThumbnailNXXX parameters, where N is a number in range from 1 to 3.
- Use the UploadThumbnailAdd() method in JavaScript to add extra thumbnail sizes, and UploadThumbnailXXX properties to change specific settings.
First method is simpler, however it allows to upload not more than 3 thumbnails per one file. The second one does not have any limitation on the number of thumbnails.
To get an upload thumbnail on the server use the UploadThumbnailX HTTP POST field, where X is an index of the upload thumbnail.
The watermark string consists of several variables separated with a semicolon:
variable1=value1;variable2=value2;...
The following variables are supported:
| Variable | Description |
|---|---|
| Text |
Watermark text. If the text contains semicolon or quotation mark characters enclose it in single (' ') or double (" ") quotes. Additionally, quotation marks (both single ' and double ") inside the text should be escaped with a backslash. For example, to get a Andrew's Photos; Vacation text, set this variable as follows: Text="Andrew\'s Photos; Vacation" Default value is an empty string. |
| Font |
Font name. This font should be installed on the client machine. That's why it is highly recommended to use some generic font like Arial, Verdana, etc. Default value is Arial. |
| ImageUrl |
Url to an image that will be used as the watermark. If a non-empty value is specified, ImageWidth and ImageHeight should also be specified. Default value is an empty string. When the image watermark is specified, the following parameter also make sense:
|
| ImageWidth |
Width of the image that will be used as the watermark. Makes sense only if the ImageUrl parameter is non-empty. The image will be resized to the specified dimensions as an ordinary thumbnail, that is, the image can only be downsized, and its proportions are kept. |
| ImageHeight |
Height of the image that will be used as the watermark. Makes sense only if the ImageUrl parameter is non-empty. The image will be resized to the specified dimensions as an ordinary thumbnail, that is, the image can only be downsized, and its proportions are kept. |
| Position |
Watermark position. It can take one of the following values:
Default value is BottomRight. |
| Size |
Font size (in pixels). Default value is 12. |
| OffsetX |
Horizontal offset (in pixels) of the watermark relatively the position it is anchored to (according to the Position variable). Default value is 0 (no offset). |
| OffsetY |
Vertical offset (in pixels) of the watermark relatively the position it is anchored to (according to the Position variable). Default value is 0 (no offset). |
| Style |
Font style. The following styles are supported:
You can specify several styles separated with a comma. Example: Style=Bold,Italic Default value is an empty string (regular font is used). |
| Opacity |
Watermark opacity percentage. If 0, the watermark is totally transparent. If 100, the watermark is opaque. Values between 0 and 100 will produce watermark with various level of transparency. This value works for all elements of watermark. There is no way to configure different opacity for background, text outline and text fill. Default value is 100. |
| Background |
Whether to draw a background under the text. Default value is false. |
| BackgroundColor |
Background color. It has the same syntax as all Image Uploader color properties (i.e. HTML-style #rrggbb RGB value). Makes sense only if the Background variable is set to true. Default value is #ffffff (white color). |
| BackgroundMarginWidth |
Width of additional space outside of the watermark filled with background (in pixels). Makes sense only if the Background variable is set to true. Default value is 0. |
| BackgroundMarginHeight |
Height of additional space outside of the watermark filled with background (in pixels). Makes sense only if the Background variable is set to true. Default value is 0. |
| Outline |
Whether to draw outline around the text. Default value is false. |
| OutlineColor |
Text outline color. It has the same syntax as all Image Uploader color properties (i.e. HTML-style #rrggbb RGB value). Makes sense only if the Outline variable is set to true. Default value is #ffffff (white color). |
| OutlineWidth |
Width of the text outline if the Outline variable is sent to true. Default value is 1. |
| Fill |
Whether to draw fill the text. Default value is true. |
| FillColor |
Font color. It has the same syntax as all Image Uploader color properties (i.e. HTML-style #rrggbb RGB value). Makes sense only if the Fill variable is set to true. Default value is #000000 (black color). |
Though you can set both image and text watermarks at the same time, it makes sense to use only one of them. For text watermarks the only required variable is Text. Here is an example of the watermark string which will draw green semi-transparent italic text Aurigma in the bottom left corner of an image:
JavaScript
iu.addParam("UploadThumbnail1Watermark",
"Text=Aurigma;Opacity=75;FillColor=#00ff00;Position=BottomLeft;Style=Italic;Size=30");For image watermarks ImageUrl, ImageWidth, and ImageHeight are required. Here is an example of semi-transparent logo drawn in the top tight corner of the image:
JavaScript
iu.addParam("UploadThumbnail1Watermark",
"ImageUrl=http://localhost/AurigmaLogo.png;ImageWidth=86;ImageHeight=63;" +
"Position=TopRight;Opacity=50");Image URLs can be both absolute (e.g. ImageUrl=http://domain.com/images/watermark.png) and relative to the current page (e.g. ImageUrl=/images/watermark.png).
For example, if Image Uploader is inserted to the http://domain.com/ImageUploader/default.aspx page, the relative URLs specified via this property will correspond to the following locations.
| Specified URL | Expected Location |
|---|---|
| "/images/watermark.png" | http://domain.com/images/watermark.png |
| "./images/watermark.png" | http://domain.com/ImageUploader/images/watermark.png |
| "images/watermark.png" | http://domain.com/ImageUploader/images/watermark.png |
| "watermark.png" | http://domain.com/ImageUploader/watermark.png |
See Also
Manual
Reference
- UploadThumbnailAdd() Method
- UploadThumbnailBackgroundColor Property
- UploadThumbnailCompressOversizedOnly Property
- UploadThumbnailCompressionMode Property
- UploadThumbnailCopyExif Property
- UploadThumbnailCopyIptc Property
- UploadThumbnailFitMode Property
- UploadThumbnailHeight Property
- UploadThumbnailJpegQuality Property
- UploadThumbnailResizeQuality Property
- UploadThumbnailResolution Property
- UploadThumbnailWidth Property
- UploadThumbnail1Watermark Property
- UploadThumbnail2Watermark Property
- UploadThumbnail3Watermark Property