Use a bitmap menu item - establish a bitmap

zhaozj2021-02-08  269

Establish a bitmap

When you set MFT_BITMAP or MF_BITMAP type tags for the menu item, you must specify the handle of the menu item that should be displayed. You can provide a bitmap resource or create a bitmap at runtime. If you use a bitmap resource, you can use the loadbitmap function to load the bitmap and get its handle.

To create a bitmap at runtime, use the Graphics Device Interface (GDI) function. GDI provides these ways to create a bitmap at runtime, but it is generally used to use the following representative methods:

Use the CreateCompaTibleDC function to create a device descriptor compatible with the application main window to use the device descriptor. Use the CreateCompaBeBitmap function to create a bitmap compatible with the application main window, or use the CreateBitmap function to create a monochrome bitmap. Use the SelectObject function to select a bitmap in a compatible device descriptor. Use GDI painting functions, such as Ellipse, and Lineto to draw images in the bitmap.

More, see Bitmaps.

转载请注明原文地址:https://www.9cbs.com/read-3416.html

New Post(0)