WatermarkableImage Class
Represents an image inside a document.
Inheritance Hierarchy
SystemObject
  GroupDocs.Watermark.ContentsContentPart
    GroupDocs.Watermark.Contents.ImageWatermarkableImage
      More...

Namespace: GroupDocs.Watermark.Contents.Image
Assembly: GroupDocs.Watermark (in GroupDocs.Watermark.dll) Version: 20.7.0
Syntax
public abstract class WatermarkableImage : ContentPart

The WatermarkableImage type exposes the following members.

Properties
  NameDescription
Public propertyHeight
Gets the height of this WatermarkableImage in pixels.
Public propertyWidth
Gets the width of this WatermarkableImage in pixels.
Methods
  NameDescription
Public methodAdd
Adds a watermark to this WatermarkableImage. This method assumes that watermark offset and size are measured in pixels (if they are assigned).
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodFindImages
Finds all images in the content. The search is conducted in the objects specified in SearchableObjects.
(Inherited from ContentPart.)
Public methodFindImages(ImageSearchCriteria)
Finds images according to the specified search criteria. The search is conducted in the objects specified in SearchableObjects.
(Inherited from ContentPart.)
Public methodGetBytes
Gets the image as byte array.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodSearch
Finds all possible watermarks in the content. The search is conducted in the objects specified in SearchableObjects.
(Inherited from ContentPart.)
Public methodSearch(SearchCriteria)
Finds possible watermarks according to specified search criteria. The search is conducted in the objects specified in SearchableObjects.
(Inherited from ContentPart.)
Public methodToString (Inherited from Object.)
Remarks
Examples
Add watermark to all images inside a document of any supported type.
C#
using (Watermarker watermarker = new Watermarker(@"D:\input.doc"))
{
    // Initialize text or image watermark.
    TextWatermark watermark = new TextWatermark("DRAFT", new Font("Arial", 19));

    // Find all images in the content.
    WatermarkableImageCollection images = watermarker.GetImages();

    // Add watermark.
    foreach (WatermarkableImage watermarkableImage in images)
    {
        watermarkableImage.Add(watermark);
    }

    // Save changes.
    watermarker.Save(@"D:\output.doc");
}
See Also
Inheritance Hierarchy