Class PictureFormat (PowerPoint VBA)

Contains properties and methods that apply to pictures and OLE objects.

Set

To use a PictureFormat class variable it first needs to be instantiated, for example

Dim pft as PictureFormat
Set pft = ActiveWindow.RangeFromPoint.PictureFormat

The following procedures can be used to set variables of type PictureFormat: ChartFormat.PictureFormat, Shape.PictureFormat, ShapeRange.PictureFormat and TableBackground.Picture

Themes

The following procedures in this class have been grouped together and are described on a separate theme page

Format with its procedures ColorType and TransparencyColor

Properties

Brightness returns or sets the brightness of the specified picture or OLE object.

ActivePresentation.Slides(1).Shapes(1).PictureFormat.Brightness = 0.3

Contrast returns or sets the contrast for the specified picture or OLE object.

ActivePresentation.Slides(1).Shapes(1).PictureFormat.Contrast = 0.8

Crop returns or sets the number of points that are cropped off the specified picture or OLE object.

Dim crpCrop As Office.Crop
Set crpCrop = ActiveWindow.RangeFromPoint.PictureFormat.Crop

CropBottom returns or sets the number of points that are cropped off the bottom of the specified picture or OLE object.

ActivePresentation.Slides(1).Shapes(1).PictureFormat.CropBottom = 20

CropLeft returns or sets the number of points that are cropped off the left side of the specified picture or OLE object.

ActivePresentation.Slides(1).Shapes(1).PictureFormat.CropLeft = 20

CropRight returns or sets the number of points that are cropped off the right side of the specified picture or OLE object.

ActivePresentation.Slides(1).Shapes(1).PictureFormat.CropRight = 20

CropTop returns or sets the number of points that are cropped off the top of the specified picture or OLE object.

ActivePresentation.Slides(1).Shapes(1).PictureFormat.CropTop = 20

Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActiveWindow.RangeFromPoint.PictureFormat.Parent

TransparentBackground determines whether parts of the picture that are the color defined as the transparent color appear transparent. Applies to bitmaps only.

ActiveWindow.RangeFromPoint.PictureFormat.TransparentBackground = msoTrue