ImageWatermark Class
Represents an image watermark.
Inheritance Hierarchy

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

The ImageWatermark type exposes the following members.

Constructors
  NameDescription
Public methodImageWatermark(Stream)
Initializes a new instance of the ImageWatermark class.
Public methodImageWatermark(String)
Initializes a new instance of the ImageWatermark class.
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. Setting this property will also change the value of SizingType property to Absolute.
(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. Setting this property will also change the value of SizingType property to Absolute.
(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
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Examples
Add image watermark to a document of any supported format.
C#
// Load a document from a file.
using (Document document = Document.Load("D:\\input.doc"))
{
    // Create ImageWatermark instance.
    using (ImageWatermark watermark = new ImageWatermark(@"D:\watermark.png"))
    {
        // Add watermark to the document.
        document.AddWatermark(watermark);
    }

    // Save changes.
    document.Save("D:\\output.doc");
}
See Also