Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mlreportgen.ppt.PicturePlaceholder class

Package: mlreportgen.ppt
Superclasses:

Slide placeholder to replace with picture

Description

Slide placeholder to replace with a picture. You can create a picture placeholder using a layout slide. In the default PPT API, when you add a Title and Picture slide to a presentation, the API creates a PicturePlaceholder object. Use the find method with the Slide object to find the picture placeholder. You can then set properties for that PicturePlaceholder object.

Use the PowerPoint® editor to insert a picture placeholder in a presentation.

  1. Select the Slide Master tab.

  2. Click the layout slide you want to add the picture placeholder to. You can add the placeholder to an existing or a new layout slide.

  3. In the toolbar, click Insert Placeholder and select Picture.

Properties

expand all

Picture placeholder name, specified as a character vector.

Upper-left x-coordinate of picture placeholder, specified in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Upper-left y-coordinate position of picture placeholder, specified in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Width of placeholder, specified in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (defaults)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Height of placeholder, specified in the form valueUnits where Units is an abbreviation for the units. Valid abbreviations are:

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Picture placeholder formatting. This property is ignored.

This read-only property lists child elements that the object contains, specified as a cell array.

This read-only property lists the parent of this object, specified a PPT object.

ID for PPT API object, specified as a character vector. A session-unique ID is generated as part of object creation. You can specify an ID to replace the generated ID.

Tag for this PPT API object, specified as a character vector. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object.

An example of a reason for specifying your own tag value is to make it easier to identify where an issue occurred during presentation generation.

Methods

Method

Purpose

replace

Replace picture placeholder with picture

Examples

expand all

Create a presentation.

import mlreportgen.ppt.*

slidesFile = 'myPicturePlaceholderPresentation.pptx';
slides = Presentation(slidesFile);
slide1 = add(slides,'Title and Picture');

Create an mlreportgen.ppt.Picture object.

plane = Picture(which('b747.jpg'));
plane.X = '1in';
plane.Y = '1in';
plane.Width = '3in';
plane.Height = '2in';

The default PPT API Title and Picture layout slide has a Picture object that is a picture placeholder. Use the mlreportgen.ppt.Slide.find method to find an object with the Name property of Picture.

contents = find(slide1,'Picture');

Replace the picture placeholder with the picture.

replace(contents(1),plane);

Close the presentation.

close(slides);

Open myPicturePlaceholderPresentation.pptx. On a Windows® platform, you can open the presentation in MATLAB®:

if ispc
    winopen(slidesFile);
end

Introduced in R2015b

Was this topic helpful?