# Function Reference

# _WinAPI_SetDIBitsToDevice

Sets the pixels in the specified rectangle on the device

#include <WinAPIGdi.au3>
_WinAPI_SetDIBitsToDevice ( $hDC, $iXDest, $iYDest, $iWidth, $iHeight, $iXSrc, $iYSrc, $iStartScan, $iScanLines, $tBITMAPINFO, $iUsage, $pBits )

## Parameters

$hDC | Handle to a device context.
$iXDest | The x-coordinate, in logical units, of the upper-left corner of the destination rectangle.
$iYDest | The y-coordinate, in logical units, of the upper-left corner of the destination rectangle.
$iWidth | The width, in logical units, of the image.
$iHeight | The height, in logical units, of the image.
$iXSrc | The x-coordinate, in logical units, of the lower-left corner of the image.
$iYSrc | The y-coordinate, in logical units, of the lower-left corner of the image.
$iStartScan | The starting scan line in the image.
$iScanLines | The number of DIB scan lines.
$tBITMAPINFO | $tagBITMAPINFO structure that contains information about the DIB.
$iUsage | The type of colors used. (either logical palette indexes or literal RGB values). The following values are defined: $DIB_PAL_COLORS $DIB_RGB_COLORS
$pBits | A pointer to the color data stored as an array of bytes.

## Return Value

Success: | the number of scan lines set. 0 - Otherwise.
Failure: | sets the @error flag to non-zero (GDI_ERROR).

## Remarks

If the driver cannot support the JPEG or PNG file image passed to SetDIBitsToDevice,
the function will fail and return GDI_ERROR.

## See Also

Search SetDIBitsToDevice in MSDN Library.