# Function Reference

# _WinAPI_SetDIBits

Sets the pixels in a compatible bitmap using the color data found in a DIB

#include <WinAPIGdi.au3>
_WinAPI_SetDIBits ( $hDC, $hBitmap, $iStartScan, $iScanLines, $pBits, $tBMI [, $iColorUse = 0] )

## Parameters

$hDC | Handle to a device context
$hBitmap | Handle to the compatible bitmap (DDB) that is to be altered using the color data from the DIB
$iStartScan | Specifies the starting scan line for the device-independent color data in the array pointed to by the $pBits parameter.
$iScanLines | Specifies the number of scan lines found in the array containing device-independent color data
$pBits | Pointer to the DIB color data, stored as an array of bytes. The format of the bitmap values depends on the biBitCount member of the $tagBITMAPINFO structure pointed to by the $pBMI parameter.
$tBMI | A $tagBITMAPINFO structure or a pointer to it that contains information about the DIB
$iColorUse | [optional] Specifies whether the iColors member of the $tagBITMAPINFO structure was provided and, if so, whether iColors contains explicit red, green, blue (RGB) values or palette indexes. The $iColorUse parameter must be one of the following values: 0 - The color table is provided and contains literal RGB values 1 - The color table consists of an array of 16-bit indexes into the logical palette of $hDC

## Return Value

Success: | True
Failure: | False

## Remarks

The device context identified by the $hDC parameter is used only if the $iColorUse is set to 1, otherwise it is ignored.
The bitmap identified by the hBmp parameter must not be selected into a device context when this function is called.
The scan lines must be aligned on a DWORD except for RLE compressed bitmaps.
The origin for bottom up DIBs is the lower left corner of the bitmap; the origin for top down DIBs is the upper left corner of the bitmap.

## Related

$tagBITMAPINFO

## See Also

Search SetDIBits in MSDN Library.