Main Content

replace

Class: mlreportgen.ppt.Picture
Namespace: mlreportgen.ppt

Replace picture

Description

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

example

Examples

expand all

Replace a picture in a presentation.

Create a presentation.

import mlreportgen.ppt.*
ppt = Presentation("myPictureReplacePresentation");
slide1 = add(ppt,"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.

add(slide1,plane);

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.

replace(plane,peppers);

Close and view the presentation.

close(ppt);
rptview(ppt);

Input Arguments

expand 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

expand all

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

Version History

Introduced in R2015b