ImageWatermark Class
Represents an image watermark.
Inheritance Hierarchy
SystemObject
  GroupDocs.WatermarkWatermark
    GroupDocs.Watermark.WatermarksImageWatermark

Namespace: GroupDocs.Watermark.Watermarks
Assembly: GroupDocs.Watermark (in GroupDocs.Watermark.dll) Version: 20.7.0
Syntax
public sealed class ImageWatermark : Watermark, 
	IDisposable

The ImageWatermark type exposes the following members.

Constructors
  NameDescription
Public methodImageWatermark(Stream)
Initializes a new instance of the ImageWatermark class with a specified stream.
Public methodImageWatermark(String)
Initializes a new instance of the ImageWatermark class with a specified file path.
Properties
  NameDescription
Public propertyConsiderParentMargins
Gets or sets a value indicating whether the watermark size and coordinates are calculated considering parent margins.
(Inherited from Watermark.)
Public propertyHeight
Gets or sets the desired height of this Watermark.
(Inherited from Watermark.)
Public propertyHorizontalAlignment
Gets or sets the horizontal alignment of this Watermark.
(Inherited from Watermark.)
Public propertyIsBackground
Gets or sets a value indicating whether the watermark should be placed at background.
(Inherited from Watermark.)
Public propertyMargins
Gets or sets the margin settings of this Watermark.
(Inherited from Watermark.)
Public propertyOpacity
Gets or sets the opacity of this Watermark.
(Inherited from Watermark.)
Public propertyRotateAngle
Gets or sets the rotate angle of this Watermark in degrees.
(Inherited from Watermark.)
Public propertyScaleFactor
Gets or sets a value that defines how watermark size depends on parent size.
(Inherited from Watermark.)
Public propertySizingType
Gets or sets a value specifying a way watermark should be sized.
(Inherited from Watermark.)
Public propertyVerticalAlignment
Gets or sets the vertical alignment of this Watermark.
(Inherited from Watermark.)
Public propertyWidth
Gets or sets the desired width of this Watermark.
(Inherited from Watermark.)
Public propertyX
Gets or sets the x-coordinate of this Watermark.
(Inherited from Watermark.)
Public propertyY
Gets or sets the y-coordinate of this Watermark.
(Inherited from Watermark.)
Methods
  NameDescription
Public methodDispose
Disposes the current instance.
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from Object.)
Remarks
Examples
Add image watermark to a document of any supported type.
C#
foreach (string filePath in Directory.GetFiles(@"C:\Documents"))
{
    using (Watermarker watermarker = new Watermarker(filePath))
    {
        using (ImageWatermark watermark = new ImageWatermark(@"C:\watermark.png"))
        {
            watermark.HorizontalAlignment = HorizontalAlignment.Center;
            watermark.VerticalAlignment = VerticalAlignment.Center;
            watermarker.Add(watermark);
        }

        watermarker.Save();
    }
}
See Also