GetBitmapDC method (Main Control)

Visual Basic example
Visual C++ 4.0 example

Visual J++ example

Syntax OLE_HANDLE GetBitmapDC ();

Overview:  Refer to Using the Windows C DLL.

Remarks

Provides a powerful set of graphics features by creating a Microsoft Windows device context, using the bitmap as the display surface. If you call this method, you must call the ReleaseBitmapDC method before using other properties or methods that affect the bitmap.

This gives you many drawing capabilities such as paint, erase, color erase and brush, pen, spray gun, flood fill, color tube, text overlay, curve, line, rectangle, polygon, ellipse, freehand shapes, cut and paste, and more.

All Windows GDI functions can be used to draw to the bitmap using the returned HDC. You should use the ReleaseBitmapDC method when the bitmap no longer needs to be available for drawing functions.

If a region is defined for the bitmap, GDI functions act only on the region, not on the entire bitmap.

This method supports only 1, 4, 8, 16 and 24 bit images. If you are using an image that has some other number of bits per pixel, use the ColorRes method to change the image to a bits per pixel value supported by the DIB driver

See Also

Topics:  Raster Images: Creating and Deleting Images
Raster Images: Drawing on a Bitmap

Examining and Altering Bitmaps