mlreportgen.ppt.Picture class

Package: mlreportgen.ppt
Superclasses:

Create picture to include in presentation

Description

Create a picture to include in a presentation.

Construction

pictureObj = mlreportgen.ppt.Picture() creates an empty picture object.

pictureObj = mlreportgen.ppt.Picture(picturePath) creates a picture object containing the picture specified by picturePath.

Note

The contents of the specified picture file are copied into the output presentation when the presentation is closed. Do not delete or overwrite the picture file before it is copied into the presentation. If you create a picture file and the corresponding mlreportgen.ppt.Picture object in a loop, for each loop iteration, use a unique file name for the picture file.

Input Arguments

expand all

Path of a picture file, specified as a character vector. Use one of these formats (you cannot use .svg format):

  • .bmp

  • .emf

  • .eps

  • .gif

  • .jpeg

  • .jpg

  • .png

  • .tif

  • .tiff

Output Arguments

expand all

Picture, returned as an mlreportgen.ppt.Picture object.

Properties

expand all

Picture name, specified as a character vector.

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

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

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

  • px — pixels (default)

  • cm — centimeters

  • in — inches

  • mm — millimeters

  • pc — picas

  • pt — points

Width of picture, 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

Height of picture, 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.

Child elements of this object, specified as a cell array of PPT objects. This property is read-only.

Parent of this object, specified as a PPT object. This property is read-only.

Tag for this PPT API object, specified as a character vector or string scalar. A session-unique tag is generated as part of the creation of this object. 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.

Specifying your own tag value can help you to identify where an issue occurred during presentation generation.

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

Methods

Method

Purpose

replace

Replace picture with another picture.

Examples

collapse all

Create a presentation with two slides.

import mlreportgen.ppt.*

slidesFile = 'myPicturePresentation.pptx';
slides = Presentation(slidesFile);

add(slides,'Title Slide');
add(slides,'Title and Content');

Create a Picture object using an airplane image available in MATLAB®. Specify the size for the picture.

plane = Picture(which('b747.jpg'));
plane.Width = '5in';
plane.Height = '2in';

Replace the content of the second slide with the plane picture.

replace(slides,'Content',plane);

Close the presentation.

close(slides);

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

if ispc
    winopen(slidesFile);
end