Creating the Bitmap

When you set the MFT_BITMAP or MF_BITMAP type flag for a menu item, you must also specify the handle of the bitmap that Windows should display for the menu item. You can provide the bitmap as a bitmap resource or create the bitmap at run time. If you use a bitmap resource, you can use the LoadBitmap function to load the bitmap and obtain its handle.

To create the bitmap at run time, use graphics device interface (GDI) functions. GDI provides several ways to create a bitmap at run time, but developers typically use the following method:

  1. Use the CreateCompatibleDC function to create a device context compatible with the device context used by the application's main window.

  2. Use the CreateCompatibleBitmap function to create a bitmap compatible with the application's main window or use the CreateBitmap function to create a monochrome bitmap.

  3. Use the SelectObject function to select the bitmap into the compatible device context.

  4. Use GDI drawing functions, such as Ellipse and LineTo, to draw an image into the bitmap.

For more information, see Bitmaps.

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database