Applies to
Picture, PictureButton, and PictureHyperLink controls, UserObject used as tab page
Description
The PictureName property specifies the name of the file that contains the picture displayed in the control. For PictureButton controls, the picture specified by the PictureName property is the one that is displayed when the button is enabled.
The picture can be in the following formats:
-
bitmap (.BMP)
-
runlength encoded (.RLE)
-
Windows metafile (.WMF)
-
GIF (.GIF)
-
JPEG (.JPG or .JPEG)
Usage
In a painter
To specify the picture for a Picture control and for the enabled state of a PictureButton:
-
Enter the name of the file in the PictureName field on the General page of the control's Properties view, or use the ellipsis button next to the PictureName field to select a file from the Select Image dialog box.
In scripts
The PictureName property takes a string value.
The following line selects a picture file for a PictureButton pb_1:
pb_1.PictureName = "c:\pictures\pb1.bmp"
Applies to
RibbonTabButtonItem, RibbonPanelItem, RibbonLargeButtonItem, RibbonSmallButtonItem, RibbonComboBoxItem, RibbonMenuItem controls
Description
The PictureName property specifies the name of the file that contains the picture displayed in the control. The picture will be displayed in 16*16 pixels for RibbonTabButtonItem, RibbonPanelItem, RibbonSmallButtonItem, and RibbonComboBoxItem, in 32*32 pixels for RibbonLargeButtonItem, and in 16*16 for RibbonMenuItem in RibbonMenu or 32*32 pixels for RibbonMenuItem in RibbonApplicationMenu.
The picture for RibbonPanelItem will be shown when the panel is collapsed (a panel is collapsed automatically when the window width becomes too small to display the panel). See the section called “Introduction to RibbonBar items” in Users Guide for more.
The picture for RibbonMenuItem will not be shown when the menu is displayed in the recent item list.
The picture is recommended to be the following formats:
-
Bitmaps (.BMP)
-
Portable Networks Graphics (.PNG)
Usage
In the RibbonBar Builder
To insert the picture name in the XML editor of the RibbonBar Builder:
-
Place the cursor in the empty string of the PictureName element in the XML editor, or double click to select the value of the PictureName element, and then click the Select Image button from the toolbar of the RibbonBar Builder.
-
In the Select Image dialog, select to use a custom image or a built-in image, and then click OK.
The selected image name will be inserted into the value of the PictureName element.
In scripts
The PictureName property takes a string value.
The following line selects the picture file for two tab buttons:
RibbonTabButtonItem lr_TabButton, lr_TabButton2 lr_TabButton.PictureName = "AddSmall!" lr_TabButton2.PictureName = "png\add.png"