mlreportgen.ppt.Picture.replace

Package: mlreportgen.ppt

Replace picture

Syntax

pictureObj = replace(picture,replacementPicture)

Description

example

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

Examples

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.

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 the presentation.

close(slides);

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