Class PictureFormat (Excel VBA)

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

Properties

Brightness returns or sets the brightness of the specified picture or OLE object. The value for this property must be a number from 0.0 (dimmest) to 1.0 (brightest).

Set myDocument = Worksheets(1) 
myDocument.Shapes(1).PictureFormat.Brightness = 0.3

ColorType returns or sets the type of color transformation applied to the specified picture or OLE object.

Set myDocument = Worksheets(1) 
myDocument.Shapes(1).PictureFormat.ColorType = msoPictureGrayScale

Contrast returns or sets the contrast for the specified picture or OLE object. The value for this property must be a number from 0.0 (the least contrast) to 1.0 (the greatest contrast).

Set myDocument = Worksheets(1) 
myDocument.Shapes(1).PictureFormat.Contrast = 0.8

Crop returns a Crop object that represents the cropping settings for the specified PictureFormat object.

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

Set myDocument = Worksheets(1) 
myDocument.Shapes(3).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.

Set myDocument = Worksheets(1) 
myDocument.Shapes(3).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.

Set myDocument = Worksheets(1) 
myDocument.Shapes(3).PictureFormat.CropRight = 20

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

Set myDocument = Worksheets(1) 
myDocument.Shapes(3).PictureFormat.CropTop = 20

Parent returns the parent object for the specified object. Read-only.

TransparencyColor returns or sets the transparent color for the specified picture as a red-green-blue (RGB) value. For this property to take effect, the TransparentBackground property must be set to True. Applies to bitmaps only.

blueScreen = RGB(0, 0, 255) 
Set myDocument = Worksheets(1) 
With myDocument.Shapes(1) 
 With .PictureFormat 
 .TransparentBackground = True 
 .TransparencyColor = blueScreen 
 End With 
 .Fill.Visible = False 
End With

TransparentBackground use the TransparencyColor property to set the transparent color. Applies to bitmaps only.

blueScreen = RGB(0, 0, 255) 
Set myDocument = Worksheets(1) 
With myDocument.Shapes(1) 
 With .PictureFormat 
 .TransparentBackground = True 
 .TransparencyColor = blueScreen 
 End With 
 .Fill.Visible = False 
End With