How to add image watermark in presentation slides

How to add image watermark in presentation slides

2015-07-14 01:19:55 Written by  Koohji
Rate this item
(0 votes)

There are two kinds of watermarks in PowerPoint documents we usually used in presentation slides: text watermark and image watermark. Text watermark and image watermark are used to make the presentation slides more attractive and shows the copyright information of the presentation slides. We have already shown you how to add text watermark to presentation slides, this section will show you how to add image watermark in PowerPoint document in C#.

Firstly, please check the effective screenshot of the image watermark in PowerPoint file added by Spire.Presentation.

How to add image watermark in presentation slides

Here comes to the steps of how to add text watermark in C#:

Step 1: Create a presentation document and load the document from the file

Presentation ppt = new Presentation();
ppt.LoadFromFile("sample.pptx");

Step 2: Set the image background type and style for the second slide in the presentation.

ppt.Slides[1].SlideBackground.Type = Spire.Presentation.Drawing.BackgroundType.Custom;
ppt.Slides[1].SlideBackground.Fill.FillType = FillFormatType.Picture;
ppt.Slides[1].SlideBackground.Fill.PictureFill.FillType = PictureFillType.Stretch;

Step 3: Insert the image as the image watermark.

Image img= Image.FromFile ("logo.png");
IImageData image = ppt.Images.Append(img);
ppt.Slides[1].SlideBackground.Fill.PictureFill.Picture.EmbedImage = image;

Step 4: Save the document.

ppt.SaveToFile("result.pptx", Spire.Presentation.FileFormat.Pptx2007);

Full codes:

using Spire.Presentation;
using Spire.Presentation.Drawing;
using System.Drawing;
namespace AddimageWatermark
{

    class Program
    {

        static void Main(string[] args)
        {
            Presentation ppt = new Presentation();
            ppt.LoadFromFile("sample.pptx");

            ppt.Slides[1].SlideBackground.Type = Spire.Presentation.Drawing.BackgroundType.Custom;
            ppt.Slides[1].SlideBackground.Fill.FillType = FillFormatType.Picture;
            ppt.Slides[1].SlideBackground.Fill.PictureFill.FillType = PictureFillType.Stretch;

            Image img = Image.FromFile("logo.png");
            IImageData image = ppt.Images.Append(img);
            ppt.Slides[1].SlideBackground.Fill.PictureFill.Picture.EmbedImage = image;
            ppt.SaveToFile("result.pptx", Spire.Presentation.FileFormat.Pptx2007);
        }
    }
}

Additional Info

  • tutorial_title: Add image watermark in presentation slides
Last modified on Friday, 24 September 2021 09:29

Coupon Code Copied!

Christmas Sale

Celebrate the season with exclusive savings

Save 10% Sitewide

Use Code:

View Campaign Details