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.replace

Package: mlreportgen.ppt

Replace picture in picture placeholder

Syntax

pictureObj = replace(picturePlaceholder,picture)

Description

example

pictureObj = replace(picturePlaceholder,picture) replaces the picture in a picture placeholder. PowerPoint® modifies the picture dimensions to fill in the picturePlaceholder dimensions. If the picture dimensions are bigger, PowerPoint stretches the image proportionally. If the picture dimensions are smaller, the picture is centered.

Examples

collapse all

Create a presentation.

import mlreportgen.ppt.*
slidesFile = 'myPlaceholderPresentation.pptx';
slides = Presentation(slidesFile);
slide1 = add(slides,'Title and Picture');

Create an mlreportgen.ppt.Picture object.

plane = Picture(which('b747.jpg'));

Find an object whose Name property is Picture.

pictures = find(slide1,'Picture');

Replace the picture in the picture placeholder.

replace(pictures(1),plane);

Generate the presentation and then open myPlaceholderPresentation.pptx. On a Windows® platform, you can open the presentation in MATLAB®:

close(slides);

if ispc
    winopen(slidesFile);
end

Input Arguments

collapse all

Picture placeholder whose picture to replace, specified as an mlreportgen.ppt.PicturePlaceholder object.

Picture to use as replacement, specified as an mlreportgen.ppt.Picture object.

Output Arguments

collapse all

Picture, represented by an mlreportgen.ppt.Picture object.

Introduced in R2015b

Was this topic helpful?