TMenuItem.Bitmap property
Bitmap image (glyph) displayed for the menu item.
Declaration
property Bitmap: TBitmap read GetBitmap write SetBitmap stored IsBitmapStored;Description
Bitmap is a
TBitmap property which contains the bitmap
image displayed as a glyph for the menu item.
The value in Bitmap can be set by assigning a TBitmap instance to the property. It may also be retrieved from images in the parent menu (or an Action list) using the ImageIndex property. The assignment mechanisms are not used at the same time. A value assigned directly to the Bitmap property overrides the setting in ImageIndex.
When loading the bitmap in the property using ImageIndex, the image width and height are automatically scaled (when needed) using the canvas scaling factor for the active screen form.
Changing the value in Bitmap causes the UpdateWSIcon method to be called to post the change to the widgetset class. The MenuChanged method is called to signal the OnChange event handler (when assigned).
Use GlyphShowMode to control use the visibility of the glyph image for the menu item.
Modified in LCL version 4.4 to scale a bitmap (when needed) when loaded using ImageIndex instead of an image directly assigned to the menu item. Fixes an issue for Retina displays on macOS - but it applies to any high DPI display.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
