Aspose::Words::ImageWatermarkOptions Class Reference

Detailed Description

Contains options that can be specified when adding a watermark with image.

#include <Aspose.Words.Cpp/ImageWatermarkOptions.h>

+ Inheritance diagram for Aspose::Words::ImageWatermarkOptions:

Public Member Functions

 ImageWatermarkOptions ()
 
bool get_IsWashout () const
 Gets or sets a boolean value which is responsible for washout effect of the watermark. The default value is True. More...
 
double get_Scale () const
 Gets or sets the scale factor expressed as a fraction of the image. The default value is 0 - auto. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void set_IsWashout (bool value)
 Setter for get_IsWashout. More...
 
void set_Scale (double value)
 Setter for get_Scale. More...
 

Static Public Member Functions

static const TypeInfoType ()
 

Constructor & Destructor Documentation

◆ ImageWatermarkOptions()

Aspose::Words::ImageWatermarkOptions::ImageWatermarkOptions ( )

Member Function Documentation

◆ get_IsWashout()

bool Aspose::Words::ImageWatermarkOptions::get_IsWashout ( ) const

Gets or sets a boolean value which is responsible for washout effect of the watermark. The default value is True.

Examples

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

auto doc = MakeObject<Document>();
// Modify the image watermark's appearance with an ImageWatermarkOptions object,
// then pass it while creating a watermark from an image file.
auto imageWatermarkOptions = MakeObject<ImageWatermarkOptions>();
imageWatermarkOptions->set_Scale(5);
imageWatermarkOptions->set_IsWashout(false);
doc->get_Watermark()->SetImage(System::Drawing::Image::FromFile(ImageDir + u"Logo.jpg"), imageWatermarkOptions);
doc->Save(ArtifactsDir + u"Document.ImageWatermark.docx");

◆ get_Scale()

double Aspose::Words::ImageWatermarkOptions::get_Scale ( ) const

Gets or sets the scale factor expressed as a fraction of the image. The default value is 0 - auto.

Valid values range from 0 to 65.5 inclusive.

Auto scale means that the watermark will be scaled to its max width and max height relative to the page margins.

Exceptions
System::ArgumentOutOfRangeExceptionThrows when argument was out of the range of valid values.
Examples

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

auto doc = MakeObject<Document>();
// Modify the image watermark's appearance with an ImageWatermarkOptions object,
// then pass it while creating a watermark from an image file.
auto imageWatermarkOptions = MakeObject<ImageWatermarkOptions>();
imageWatermarkOptions->set_Scale(5);
imageWatermarkOptions->set_IsWashout(false);
doc->get_Watermark()->SetImage(System::Drawing::Image::FromFile(ImageDir + u"Logo.jpg"), imageWatermarkOptions);
doc->Save(ArtifactsDir + u"Document.ImageWatermark.docx");

◆ GetType()

virtual const System::TypeInfo & Aspose::Words::ImageWatermarkOptions::GetType ( ) const
overridevirtual

Reimplemented from System::Object.

◆ Is()

virtual bool Aspose::Words::ImageWatermarkOptions::Is ( const System::TypeInfo target) const
overridevirtual

Reimplemented from System::Object.

◆ set_IsWashout()

void Aspose::Words::ImageWatermarkOptions::set_IsWashout ( bool  value)

◆ set_Scale()

void Aspose::Words::ImageWatermarkOptions::set_Scale ( double  value)

◆ Type()

static const System::TypeInfo & Aspose::Words::ImageWatermarkOptions::Type ( )
static