A newer version of this page is available. Switch to the current version.

PageWatermark.ImageTransparency Property

Gets or sets the transparency of the watermark's image.

Namespace: DevExpress.XtraPrinting.Drawing

Assembly: DevExpress.Printing.v18.2.Core.dll


public int ImageTransparency { get; set; }
Public Property ImageTransparency As Integer

Property Value

Type Default Description


An integer value specifying the images's transparency. It should be between 0 and 255, inclusive.


Use this property to specify the transparency of the watermark's image. The watermark's image can be accessed via the PageWatermark.Image property.


This example demonstrates how a watermark can be added to a printing system document. The SetTextWatermark method demonstrates the properties which are useful when a text watermark is added to a document, while the SetPictureWatermark method demonstrates the properties required to set a picture as the document's watermark.

using System.Drawing;
using DevExpress.XtraPrinting;
using DevExpress.XtraPrinting.Drawing;
// ...

public void SetTextWatermark(PrintingSystem ps){
   // Create the text watermark.
   Watermark textWatermark = new Watermark();

   // Set watermark options.
   textWatermark.Text = "CUSTOM WATERMARK TEXT";
   textWatermark.TextDirection = DirectionMode.ForwardDiagonal;
   textWatermark.Font = new Font(textWatermark.Font.FontFamily, 40);
   textWatermark.ForeColor = Color.DodgerBlue;
   textWatermark.TextTransparency = 150;
   textWatermark.ShowBehind = false;
   textWatermark.PageRange = "1,3-5";

   // Set the watermark to a document.

public void SetPictureWatermark(PrintingSystem ps){
   // Create the picture watermark.
   Watermark pictureWatermark = new Watermark();

   // Set watermark options.
   pictureWatermark.Image = Bitmap.FromFile("watermark.gif");
   pictureWatermark.ImageAlign = ContentAlignment.TopCenter;
   pictureWatermark.ImageTiling = false;
   pictureWatermark.ImageViewMode = ImageViewMode.Stretch;
   pictureWatermark.ImageTransparency = 150;
   pictureWatermark.ShowBehind = true;
   pictureWatermark.PageRange = "2,4";

   // Set the watermark to a document.
See Also