Aspose::Words::Watermark::SetImage method

Watermark::SetImage(const System::SharedPtr<System::Drawing::Image>&) method

Adds Image watermark into the document.

void Aspose::Words::Watermark::SetImage(const System::SharedPtr<System::Drawing::Image> &image)
ParameterTypeDescription
imageconst System::SharedPtr<System::Drawing::Image>&Image that is displayed as a watermark.

See Also

Watermark::SetImage(const System::SharedPtr<System::Drawing::Image>&, const System::SharedPtr<Aspose::Words::ImageWatermarkOptions>&) method

Adds Image watermark into the document.

void Aspose::Words::Watermark::SetImage(const System::SharedPtr<System::Drawing::Image> &image, const System::SharedPtr<Aspose::Words::ImageWatermarkOptions> &options)
ParameterTypeDescription
imageconst System::SharedPtr<System::Drawing::Image>&Image that is displayed as a watermark.
optionsconst System::SharedPtr<Aspose::Words::ImageWatermarkOptions>&Defines additional options for the image watermark.

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");

See Also

Watermark::SetImage(const System::String&, const System::SharedPtr<Aspose::Words::ImageWatermarkOptions>&) method

Adds Image watermark into the document.

void Aspose::Words::Watermark::SetImage(const System::String &imagePath, const System::SharedPtr<Aspose::Words::ImageWatermarkOptions> &options)
ParameterTypeDescription
imagePathconst System::String&Path to the image file that is displayed as a watermark.
optionsconst System::SharedPtr<Aspose::Words::ImageWatermarkOptions>&Defines additional options for the image watermark.

See Also