When Windows calls the Enable function the first time, a graphics driver should initialize the members of the GDIINFO structure that contain information about the device's bitmap technology and capabilities. The following table identifies these members and their purpose:
GDIINFO member | Purpose |
dpTechnology | Specifies the device technology (vector, raster, metafile, and so on). |
dpHorzRes | Specifies the horizontal resolution of the device. |
dpVertRes | Specifies the vertical resolution of the device. |
dpBitsPixel | Specifies the number of adjacent bits required to define a single pixel. |
dpPlanes | Specifies the number of planes required to define a single pixel. |
dpRaster | Specifies the raster capabilities (if any) of the device. |
dpAspectX | Specifies the width of a device pixel. |
dpAspectY | Specifies the height of a device pixel. |
dpAspectXY | Specifies the diagonal width of a device pixel. |
dpCaps1 | Specifies additional raster capabilities. |
If the device is a raster printer or a video display, it must set the appropriate GDIINFO members and support the following bitmap functions: BitBlt, BitmapBits, CreateDIBitmap, Pixel, SaveScreenBitmap, SelectBitmap, SetDIBitsToDevice, StretchBlt, StretchDIBits, and ScanLR. In addition, if the device provides device bitmaps, it must support the DeviceBitmap and DeviceBitmapBits functions.
The BitBlt function transfers bits of color data that correspond to a rectangle of pixels on the display from one location in video memory to another location in video memory (the new location corresponds to a second rectangle of pixels). This function is one of the most frequently called display-driver functions and is typically handled by hardware accelerators. The BitmapBits function has multiple purposes, GDI calls it to set bits on a device, to copy bits from a device to a buffer, and to copy bits from a buffer to a device. The three device-independent bitmap (DIB) functions, CreateDIBitmap, SetDIBitsToDevice, and StretchDIBits, perform common operations on DIBs. If a device supports DIBs, it should set the RC_DI_BITMAP value for the dpRaster member of the GDIINFO structure and support each of these functions. The Pixel function sets or retrieves the color of a single pixel with the specified coordinates. The SaveScreenBitmap function is called frequently to save parts of the screen that have been covered by a menu, a dialog box, or some other control or window. The SelectBitmap function is called when an application selects a bitmap into its device context. The StretchBlt function is called to compress or expand the color data for a bitmap that is being copied from one location to another. If a device supports device-dependent bitmaps, it should set the RC_DI_BITMAP value for the dpRaster member of the GDIINFO structure and support the two device-dependent bitmap functions: DeviceBitmap and DeviceBitmapBits.
See also Enable, GDIINFO, BitBlt, BitmapBits, BITMAPINFO, BITMAPINFOHEADER, CreateDIBitmap, DeviceBitmap, DeviceBitmapBits, Pixel, SaveScreenBitmap, SelectBitmap, SetDIBitsToDevice, StretchBlt, StretchDIBits, ScanLR