Aspose::Words::ImageWatermarkOptions class

ImageWatermarkOptions class

Contains options that can be specified when adding a watermark with image. To learn more, visit the Working with Watermark documentation article.

class ImageWatermarkOptions : public System::Object

Methods

MethodDescription
get_IsWashout() constGets or sets a boolean value which is responsible for washout effect of the watermark. The default value is true.
get_Scale() constGets or sets the scale factor expressed as a fraction of the image. The default value is 0 - auto.
GetType() const override
ImageWatermarkOptions()
Is(const System::TypeInfo&) const override
set_IsWashout(bool)Setter for Aspose::Words::ImageWatermarkOptions::get_IsWashout.
set_Scale(double)Setter for Aspose::Words::ImageWatermarkOptions::get_Scale.
static Type()

Examples

Shows how to create a watermark from an image in the local file system.

auto doc = System::MakeObject<Aspose::Words::Document>();

// Modify the image watermark's appearance with an ImageWatermarkOptions object,
// then pass it while creating a watermark from an image file.
auto imageWatermarkOptions = System::MakeObject<Aspose::Words::ImageWatermarkOptions>();
imageWatermarkOptions->set_Scale(5);
imageWatermarkOptions->set_IsWashout(false);

// We have a different options to insert image.
// Use on of the following methods to add image watermark.
doc->get_Watermark()->SetImage(System::Drawing::Image::FromFile(get_ImageDir() + u"Logo.jpg"));

doc->get_Watermark()->SetImage(System::Drawing::Image::FromFile(get_ImageDir() + u"Logo.jpg"), imageWatermarkOptions);

doc->get_Watermark()->SetImage(get_ImageDir() + u"Logo.jpg", imageWatermarkOptions);

doc->Save(get_ArtifactsDir() + u"Document.ImageWatermark.docx");

See Also