This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Package: mlreportgen.ppt

Replace picture


pictureObj = replace(picture,replacementPicture)



pictureObj = replace(picture,replacementPicture) replaces a picture with another picture.


collapse all

Create a presentation.

import mlreportgen.ppt.*

slides = Presentation('myPictureReplacePresentation');
slide1 = add(slides,'Blank');

Create an mlreportgen.ppt.Picture object.

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

Add the picture to the slide.


Create a second picture.

peppers = Picture(which('peppers.png'));
peppers.X = '1in';
peppers.Y = '1in';
peppers.Width = '3in';
peppers.Height = '3in';

Replace the plane picture with the peppers picture.


Close the presentation.


Input Arguments

collapse all

Picture to replace, specified as an mlreportgen.ppt.Picture object.

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

Output Arguments

collapse all

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

Introduced in R2015b