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.Picture class

Package: mlreportgen.ppt
Superclasses:

Create picture to include in presentation

Description

Create a picture to include in a presentation.

Construction

pictureObj = Picture() creates an empty picture object.

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

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.

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.

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.

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.

Methods

Method

Purpose

replace

Replace picture with another picture.

Examples

expand 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

Was this topic helpful?