Two Methods of Creating Bitmaps for Menus

To insert a bitmap into a menu, you use AppendMenu or InsertMenu. Where does this bitmap come from? It can come from one of two places. First, you can create a bitmap using SDKPAINT and include the bitmap file in your resource script. Within the program, you can use LoadBitmap to load the bitmap resource into memory and use AppendMenu or InsertMenu to attach it to the menu. There's a problem with this approach, however. The bitmap will not be suitable for all types of video resolutions and aspect ratios; you have to stretch the loaded bitmap to account for this. Alternatively, you can create the bitmap right in the program and attach it to the menu.

Both of these methods sound a lot more difficult than they actually are. We don't have to mess around with the actual bits themselves. Windows provides functions that let us manipulate bitmaps cleanly using something called the ”memory device context.“