Function Reference


Retrieves the bits of the specified bitmap and copies them into a buffer as a DIB

#include <WinAPIGdi.au3>
_WinAPI_GetDIBits ( $hDC, $hBitmap, $iStartScan, $iScanLines, $pBits, $tBI, $iUsage )


$hDC Handle to the device context
$hBitmap Handle to the bitmap. This must be a compatible bitmap (DDB).
$iStartScan Specifies the first scan line to retrieve
$iScanLines Specifies the number of scan lines to retrieve
$pBits Pointer to a buffer to receive the bitmap data.
If this parameter is 0, the function passes the dimensions and format of the bitmap to the $tagBITMAPINFO structure pointed to by the $tBI parameter.
$tBI A $tagBITMAPINFO structure or a pointer to it that specifies the desired format for the DIB data
$iUsage Specifies the format of the bmiColors member of the $tagBITMAPINFO structure.
It must be one of the following values:
    $DIB_PAL_COLORS - The color table should consist of an array of 16-bit indexes into the current palette
    $DIB_RGB_COLORS - The color table should consist of literal red, green, blue values

Return Value

Success: If $pBits is not 0 and the function succeeds, the return value is the number of scan lines copied from the bitmap.
If $pBits is 0 and GetDIBits successfully fills the structure, the return value is True.
Failure: False



See Also

Search GetDIBits in MSDN Library.