GetImages

GetImages(ImageSearchCriteria)

Finds images according to specified search criteria.

public WatermarkableImageCollection GetImages(ImageSearchCriteria searchCriteria)
Parameter Type Description
searchCriteria ImageSearchCriteria The search criteria to use.

Return Value

The collection of found images.

Remarks

The search is conducted in objects specified in SearchableObjects.

Learn more about searching watermarks Searching watermarks.

Examples

Remove all images that are similar to the reference from a document of any supported type.

using (Watermarker watermarker = new Watermarker(@"D:\input.doc"))
{
    ImageThumbnailSearchCriteria criteria = new ImageThumbnailSearchCriteria("reference.png");
    WatermarkableImageCollection images = watermarker.GetImages(criteria);
    images.Clear();
    watermarker.Save(@"D:\output.doc");
}

See Also


GetImages()

Finds all images in the document.

public WatermarkableImageCollection GetImages()

Return Value

The collection of found images.

Remarks

The search is conducted in objects specified in SearchableObjects.

Learn more about searching watermarks Searching watermarks.

Examples

Add watermark to all images in a document of any supported type.

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 document.
    WatermarkableImageCollection images = watermarker.GetImages();

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

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

See Also