Adding Watermark to image using WebImage Helper

January 9, 2011 at 3:44 PM

One of the cool helper which impress me a lot in ASP.NET WebPages using WebMatrix will be the WebImage Helper.

By using WebImage Helper, you can simplified most common image manipulation operations like adding watermark to images, resize the photo, flip or rotate the image and etc.

To add text watermark to images, you just need to called the WebImage.AddTextWatermark() method.

Full supported syntax :

Example of using this Helper :

  


Any image that being load will be added the text watermark value which is "http://blog.scnetstudio.com" with the font color of red, font family of Arial and the size of the text watermark will be 20. 

Beside adding with text watermark, you can add image watermark ontop the images as well. In another word, an image on top of another image which act as a watermark.

Full supported syntax :

Example of using this Helper :

The above example show that another image was added as a watermark with the parameter of width, height of the watermark image, the alignment of the watermark image as well as the opacity and padding value.

Demo on adding text watermark.

Posted in: MVP | Technical Stuff

Tags: ,