Aspose::Words::ImageWatermarkOptions class
Contents
[
Hide
]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
Method | Description |
---|---|
get_IsWashout() const | Gets or sets a boolean value which is responsible for washout effect of the watermark. The default value is true. |
get_Scale() const | Gets 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
- Namespace Aspose::Words
- Library Aspose.Words for C++