Windows 3.1 Device Drivers (ddag31qh.hlp) (Table of Contents; Topic list)
SetDIBitsToDevice
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
WORD SetDIBitsToDevice(lpDestDev, X, Y, iScan, cScans, lpClipRect,
                       lpDrawMode, lpDIBits, lpBitmapInfo, lpTranslate)
LPPDEVICE lpDestDev;         /* points to device                       */
WORD X;                      /* top left corner <x>-coordinate           */
WORD Y;                      /* top left corner <y>-coordinate           */
WORD iScan;                  /* start scan line in the DIB buffer      */
WORD cScans;                 /* number of scans to copy                */
LPRECT lpClipRect;           /* points to clip rectangle on screen     */
LPDRAWMODE lpDrawMode;       /* points to drawing mode information     */
LPSTR lpDIBits;              /* points to the DIB buffer               */
LPBITMAPINFO lpBitmapInfo;   /* points to bitmap information           */
LPINT lpTranslate;           /* points to conversion-translation table */
 
The SetDIBitsToDevice function copies device-independent bitmap data
directly to the given device. The function converts the bitmap data to the
appropriate device-specific format and copies the resulting bits to the
device. GDI calls this function whenever an application calls the
SetDIBitsToDevice function (GDI.443).
 
A graphics device driver must export the SetDIBitsToDevice function if the
RC_DIBTODEV value is set in the dpRaster member of the driver's GDIINFO
structure.
 
Parameter     Description
────────────────────────────────────────────────────────────────────────────
 
lpDestDev     Points to a PDEVICE structure specifying the device to receive
              the device-independent bitmap.
 
X             Specifies the x-coordinate (in device units) to receive the
              top left corner of the device-independent bitmap.
 
Y             Specifies the y-coordinate (in device units) to receive the
              top left corner of the device-independent bitmap.
 
iScan         Specifies the starting scan line.
 
cScans        Specifies the number of scan lines to copy.
 
lpClipRect    Points to a RECT structure specifying the clip rectangle.
 
lpDrawMode    Points to a DRAWMODE structure specifying the background mode
              and background color to use while copying the bitmap.
 
lpDIBits      Points to a buffer containing the device-independent bitmap
              bits.
 
lpBitmapInfo  Points to a BITMAPINFO structure specifying the dimensions and
              format of the device-independent bitmap.
 
              If the RLE_FORMAT_4 or RLE_FORMAT_8 values are set in the
              biCompression member, the bitmap is in run-length-encoded
              (RLE) format. In this case, the function must decode the data
              as it retrieves it from the buffer pointed to by the lpDIBits
              parameter.
 
lpTranslate   Points to an array of color-translation values for converting
              palette colors to actual device colors. This parameter is
              ignored by devices that do not use color palettes.
 
Return Value
 
The return value is the number of scan lines actually copied, if successful.
Otherwise, it is zero if there is an error or no scan lines are copied.
 
Comments
 
The export ordinal for this function is 21.
 
The function removes the cursor before copying the bitmap bits to the
display device and restores the cursor after copying.
 
See Also
 
DeviceBitmapBits, StretchDIBits, BITMAPINFO, DRAWMODE, PDEVICE, RECT