If you create a presentation from an existing presentation, a picture from the existing presentation (a template picture) is represented by an mlreportgen.ppt.TemplatePicture
object. You can change the position, width, and height of the template picture by setting properties of the object. You can also modify the XML markup of the template picture. To replace the template picture, use the replace method of the TemplatePicture
object. For example, suppose that you create a presentation from an existing presentation myPresentation
that has a slide with the 'Title and Picture'
layout. The following code replaces the template picture with a different picture.
Generate a presentation, MyPicturePresentation
, that you then use as the template presentation for another presentation. MyPicturePresentation
has one slide with one picture.
Close and view the presentation.
Create a presentation, MyNewPicturePresentation
, from MyPicturePresentation
. MyPicturePresentation
is the template presentation for MyNewPicturePresentation
,
Find the template picture by using the find
method of the slide object. Because the picture comes from a template presentation slide, find
returns the picture as an mlreportgen.ppt.TemplatePicture
object.
templatePictureObj =
TemplatePicture with properties:
XMLMarkup: '<p:pic><p:nvPicPr><p:cNvPr id="8" name="Picture"/><p:cNvPicPr><a:picLocks noChangeAspect="1" noGrp="1"/></p:cNvPicPr><p:nvPr><p:ph idx="13" sz="quarter" type="pic"/></p:nvPr></p:nvPicPr><p:blipFill><a:blip r:embed="rId2"><a:extLst><a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}"><a14:useLocalDpi val="0" xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main"/></a:ext></a:extLst></a:blip><a:stretch><a:fillRect/></a:stretch></p:blipFill><p:spPr/></p:pic>'
Name: 'Picture'
X: []
Y: []
Width: []
Height: []
Style: []
Children: []
Parent: [1×1 mlreportgen.ppt.Slide]
Tag: 'ppt.TemplatePicture:70:263'
Id: '70:263'
Replace the picture with a different picture.
Close and view the presentation.