Bitmap controls are very similar to icon controls, and come in the same two flavors – static (MBF_STATIC + MBF_BITMAP) and button (MBF_BUTTON + MBF_BITMAP). The main differences between bitmaps and icons are:
• | Icons (whether stored in an ICO file or in a resource) typically contain variations of themselves with different color depths and grid sizes, from which Windows will usually select the most appropriate one. Bitmaps, on the other hand, are stored with only one size, and are typically converted internally to a format appropriate for the display device. |
• | Icons are square, whereas bitmaps can be in any rectangular shape. |
• | The MBF_NODISTORT flag only applies (as of build 919) to icons. |
For both bitmap and icon controls, the ctext parameter must be set to either the filespec of the image file, or a DLL resource identifier (in the format resname::dllname).
Examples
! clickable button with JPG bitmap loaded from file
xcall AUI, AUI_CONTROL, CTLOP_ADD, "btnCoffee", "IMAGES:COFFEE.JPG", MBST_ENABLE, MBF_BUTTON+MBF_BITMAP+MBF_KBD, "VK_xF101", NUL_FUNC$, CSTATUS, SROW, SCOL, EROW, ECOL
! static with bitmap loaded from resource called "logo1" within images.dll
xcall AUI, AUI_CONTROL, CTLOP_ADD, "stcLogo1", "logo1::images", MBST_ENABLE, MBF_STATIC+MBF_BITMAP, NUL_CMD$, NUL_FUNC$, CSTATUS, SROW, SCOL, EROW, ECOL
! static clickable using PNG bitmap loaded from file
xcall AUI, AUI_CONTROL, CTLOP_ADD, "stcBrain", "brain.png", MBST_ENABLE, MBF_STATIC+MBF_BITMAP+MBF_KBD, NUL_CMD$,"VK_xF02", NUL_FUNC$, CSTATUS, SROW, SCOL, EROW, ECOL
History
2010 June, 5.1.1183: Add ability to reference bitmap DLL resources
2007, A-Shell 5.0: Icon DLL resources supported