menu

UWP

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PictureWatermark - UWP API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PictureWatermark

    Represents the picture that appears behind the document.

    Inheritance
    System.Object
    OwnerHolder
    XDLSSerializableBase
    Entity
    WidgetBase
    ParagraphItem
    Watermark
    PictureWatermark
    Implements
    IXDLSSerializable
    IParagraphItem
    IEntity
    IOfficeRun
    Inherited Members
    Entity.Clone()
    Entity.IsComposite
    Entity.NextSibling
    Entity.Owner
    Entity.PreviousSibling
    OwnerHolder.Document
    OwnerHolder.m_doc
    ParagraphItem.ApplyStyle(String)
    ParagraphItem.CloneRun()
    ParagraphItem.Dispose()
    ParagraphItem.IsDeleteRevision
    ParagraphItem.IsInsertRevision
    ParagraphItem.m_charFormat
    ParagraphItem.OwnerMathRunElement
    ParagraphItem.OwnerParagraph
    Watermark.EntityType
    Watermark.Type
    XDLSSerializableBase.IXDLSSerializable.ReadXmlAttributes(IXDLSAttributeReader)
    XDLSSerializableBase.IXDLSSerializable.ReadXmlContent(IXDLSContentReader)
    XDLSSerializableBase.IXDLSSerializable.RestoreReference(String, Int32)
    XDLSSerializableBase.IXDLSSerializable.WriteXmlAttributes(IXDLSAttributeWriter)
    XDLSSerializableBase.IXDLSSerializable.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.IXDLSSerializable.XDLSHolder
    XDLSSerializableBase.ReadXmlContent(IXDLSContentReader)
    XDLSSerializableBase.RestoreReference(String, Int32)
    XDLSSerializableBase.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.XDLSHolder
    Namespace: Syncfusion.DocIO.DLS
    Assembly: Syncfusion.DocIO.UWP.dll
    Syntax
    public class PictureWatermark : Watermark, IXDLSSerializable, IWidget, IParagraphItem, IEntity, IOfficeRun
    Examples

    The following code snippet illustrates how to add a picture watermark to the Word document.

    private void Button1_Click(System.Object sender, System.EventArgs e)
    {
        //Create a new Word document
        WordDocument document = new WordDocument();
        //Add a section and a paragraph in the document
        document.EnsureMinimal();
        IWParagraph paragraph = document.LastParagraph;
        paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua");
        //Create a new picture watermark
        PictureWatermark picWatermark = new PictureWatermark();
        //Set the scaling to picture
        picWatermark.Scaling = 120f;
        picWatermark.Washout = true;
        //Set the picture watermark to document
        document.Watermark = picWatermark;
        //Set the image to the picture watermark
        picWatermark.Picture = Image.FromFile("ImagesPath" + "Water lilies.jpg");
        document.Save("PictureWatermark.docx", FormatType.Docx);
        document.Close();
    }
    Private Sub button_Click(sender As Object, e As EventArgs)
        'Create a new Word document
        Dim document As New WordDocument()
        'Add a section and a paragraph in the document
        document.EnsureMinimal()
        Dim paragraph As IWParagraph = document.LastParagraph
        paragraph.AppendText("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua")
        'Create a new picture watermark
        Dim picWatermark As New PictureWatermark()
        'Set the scaling to picture
        picWatermark.Scaling = 120.0F
        picWatermark.Washout = True
        Set the picture watermark to document
        document.Watermark = picWatermark
        Set the image to the picture watermark
        picWatermark.Picture = Image.FromFile(ImagesPath + "Water lilies.jpg")
        document.Save("PictureWatermark.docx", FormatType.Docx)
        document.Close()
    End Sub

    Constructors

    PictureWatermark()

    Initializes a new instance of the PictureWatermark class.

    Declaration
    public PictureWatermark()

    Properties

    Scaling

    Gets or sets the picture scaling value in percents.

    Declaration
    public float Scaling { get; set; }
    Property Value
    Type Description
    System.Single

    The float that specifies the picture scaling value.

    Washout

    Gets or sets a value indicating whether the washout property is enabled for the picture watermark. The default value is true.

    Declaration
    public bool Washout { get; set; }
    Property Value
    Type Description
    System.Boolean

    True if to have light shading effect to picture; otherwise, false.

    Methods

    CloneImpl()

    Clones itself.

    Declaration
    protected override object CloneImpl()
    Returns
    Type Description
    System.Object

    Returns cloned object.

    Overrides
    ParagraphItem.CloneImpl()

    InitXDLSHolder()

    Registers child objects in XDSL holder.

    Declaration
    protected override void InitXDLSHolder()
    Overrides
    XDLSSerializableBase.InitXDLSHolder()

    LoadPicture(Byte[])

    Load watermark image

    Declaration
    public void LoadPicture(byte[] bytes)
    Parameters
    Type Name Description
    System.Byte[] bytes

    ReadXmlAttributes(IXDLSAttributeReader)

    Reads object data from xml attributes.

    Declaration
    protected override void ReadXmlAttributes(IXDLSAttributeReader reader)
    Parameters
    Type Name Description
    IXDLSAttributeReader reader

    The IXDLSAttributeReader object.

    Overrides
    Watermark.ReadXmlAttributes(IXDLSAttributeReader)

    WriteXmlAttributes(IXDLSAttributeWriter)

    Writes object data as xml attributes.

    Declaration
    protected override void WriteXmlAttributes(IXDLSAttributeWriter writer)
    Parameters
    Type Name Description
    IXDLSAttributeWriter writer

    The IXDLSAttributeWriter object.

    Overrides
    Watermark.WriteXmlAttributes(IXDLSAttributeWriter)

    Implements

    IXDLSSerializable
    IParagraphItem
    IEntity
    IOfficeRun

    Extension Methods

    DateTimeExtension.ToDateTime(Object)

    See Also

    Watermark
    TextWatermark
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved