Visual C#.NET: Create Watermark

How to create watermark on images using C#.NET
For some users, content security is of great importance. To solve this problem, Yiigo Document Image products provides watermark creation functions, allowing users to easily create text- or image-based watermark overlays that can be applied to a single page or a range of pages within a document for viewing and printing. Find more watermark creation information on Yiigo.Image for .NET Process Support.
Yiigo.Image for .NET has those following functionalities:
  • Apply watermarks to any images & documents
  • Support watermark objects, such as date and time stamp, confidential disclaimers, etc.
  • Support creating both text- and image-based watermark
  • Support creating both text- and image-based watermark
This document provides comprehensive Visual C#.NET samples for guiding developers to create watermark using Yiigo.Image for .NET. Find more watermark creation tutorials on Create Watermark in VB.NET, Web Imaging Viewer Watermark Creation and Create Watermark in .NET Winforms.
Create Watermark on Images with C#.NET Sample Code

Requirements

Before create watermark on image and documents using Yiigo.Image for .NET in Visual C#.NET, make sure that you have installed.
  • Operating systems - Windows 7, Windows Vista, and Windows XP, etc
  • Compatible with .NET framework 2.0 and above versions
  • Support Visual Studio 2005, 2010 and other .NET development environments
  • Yiigo.Image for .NET installation

Start to Create Text-Based Watermark on Images

  • Open and run your Microsoft Visual Studio;
  • Choose either "Visual C# Projects" in "New Project" dialog box;
  • Choose "Windows Application" in the "Templates" List and name it "YiigoImagingWatermarkCsharp";
  • Right-click on the "References" folder, and select "Add Reference..." from the context menu in the "Solution Explorer" window;
  • In the "Add Reference" dialog box, select the ".NET" tab and browse to Yiigo.Imaging.Net.dll library;
  • Add it to your Visual C# applications;
  • Call Yiigo .NET Image Namespace & Copy those following codes:
using System.IO;
using System.Drawing.Printing;
using Yiigo.Imaging;
using Yiigo.Imaging.Processing;

using YiigoImage Image = new YiigoImage();
{
string ImageID = (@"C:\ yiigo_example.jpg ");
WatermarkType WatermarkType = WatermarkType.Text;
// create Watermark Text
string text = "Copyright © YIIGO.com 2012. All Rights Reserved.";
color TextColor = Color.Blue;
font TextFont = new Font("Arial", 9f, FontStyle.Regular);
}
Image.YiigoImageProcessCreateWartermark(@"C:\ yiigo_example.jpg", "Yiigo.com",
Color.Blue, new Font("Arial", 9f, FontStyle.Regular));
Image.Save(@"C:\ yiigo_example.jpg");

Start to Create Image-Based Watermark on Images

using System.IO;
using System.Drawing.Printing;
using Yiigo.Imaging;
using Yiigo.Imaging.Processing;

using YiigoImage Image = new YiigoImage();
{
string ImageID = (@"C:\ yiigo_example.jpg ");
WatermarkType WatermarkType = WatermarkType.Image;
// create Watermark Image
Graphics graphics=new Graphics(watermark image);
{
int wmWidth = "30";
int wmHeight = "15";
point = new point(image.Width/2, image.Height/2);
}
}
Image.YiigoImageProcessCreateWartermark(@"C:\ yiigo_example.jpg", watermark image, "30", "15",
new point(image.Width/4, image.Height/4));
Image.Save(@"C:\ yiigo_example.jpg");
Products
Other Plugins
Image Viewer CoreBarcode PluginPDF Read & WriteTesseract OCR PluginForm Processing PluginJBIG2 CodecJPEG2000 CodecISIS ScannerTwain ScannerDICOM ReaderCAD Scanner