Creating Bitmaps

You create a bitmap by supplying GDI with the dimensions and color format of the bitmap, and, optionally, the initial value of the bitmap bits. GDI then returns a handle to the bitmap. You can use this handle in subsequent GDI functions to select and display the bitmap.

You can create bitmaps in the following ways:

You can use the Image Editor application to draw the bitmap image and save it in a file. You then add the bitmap file to your application's resources. Your application loads the bitmap using the LoadBitmap function.

Your application can first create a blank bitmap and then use GDI output functions to draw the bitmap bits.

To hard-code a bitmap, your application can create a blank bitmap and initialize its bits using an array of bits.

Your application can create a bitmap and initialize its bits using the image in an existing DIB.

The following sections explain how to use each of these methods to create
bitmaps.