To create a picture for a presentation, use the mlreportgen.ppt.Picture
constructor.
Specify the path to a picture file. The picture file must use one
of these formats (you cannot use .svg
format):
.bmp
.emf
.eps
.gif
.jpeg
.jpg
.png
.tif
.tiff
For example:
import mlreportgen.ppt.* slides = Presentation('slides'); pictureSlide = add(slides,'Blank'); plane = Picture(which('b747.jpg')); plane.Width = '5in'; plane.Height = '2in'; add(pictureSlide,plane); close(slides);
When you create a Picture
object, you can
specify the location, width, and height. The specified formatting
applies when you add a picture to a slide or replace a Picture
object.
When you replace a PicturePlaceholder
object with
a Picture
object, PowerPoint® adjusts the replacement
picture to fit the location and dimensions of the placeholder.
You can specify these format properties for a Picture
object.
Picture Object
Formatting | Format Object | Format Property |
---|---|---|
Upper-left x-coordinate of picture | n/a |
|
Upper-left y-coordinate of picture | n/a |
|
Picture width | n/a |
|
Picture height | n/a |
|