Skip to main content
All docs
V24.2

WatermarkCollection.AddRange(Watermark[]) Method

Adds the specified watermarks to WatermarkCollection.

Namespace: DevExpress.XtraPrinting.Drawing

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

Declaration

public void AddRange(
    Watermark[] items
)

Parameters

Name Type Description
items Watermark[]

An array of Watermark objects.

Remarks

This example demonstrates how to add watermarks to a report document.

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

public partial class XtraReport1 : DevExpress.XtraReports.UI.XtraReport {
   public XtraReport1() {
      InitializeComponent();
      Watermark pictureWatermark = new Watermark();

      // Set watermark options.
      pictureWatermark.Image = Bitmap.FromFile("watermark.png");
      pictureWatermark.ImageAlign = ContentAlignment.TopCenter;
      pictureWatermark.ImageTiling = false;
      pictureWatermark.ImageViewMode = ImageViewMode.Stretch;
      pictureWatermark.ImageTransparency = 150;
      pictureWatermark.ImagePosition = WatermarkPosition.Behind;
      pictureWatermark.PageRange = "1"; 
      Watermark textWatermark = new Watermark();
      // Set watermark options.
      textWatermark.Text = "CUSTOM WATERMARK TEXT";
      textWatermark.TextDirection = DirectionMode.ForwardDiagonal;
      textWatermark.Font = new DXFont(textWatermark.Font.Name, 40);
      textWatermark.ForeColor = Color.DodgerBlue;
      textWatermark.TextTransparency = 150;
      textWatermark.TextPosition = WatermarkPosition.InFront;
      textWatermark.PageRange = "1";
      // Add watermarks to the collection.
      Watermarks.AddRange(new Watermark[] { pictureWatermark, textWatermark });
      }
}
See Also