[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'InterfaceBase' (#lcl)

# TWidgetSet.GetDIBits

Fills a buffer with bitmap color bits.

## Declaration

Source position: winapih.inc line 125

`public function TWidgetSet.GetDIBits(`
`DC: HDC;`
`Bitmap: HBITMAP;`
`StartScan: UINT;`
`NumScans: UINT;`
`Bits: Pointer;`
`var BitInfo: BITMAPINFO;`
`Usage: UINT`
`):Integer; virtual;`

## Arguments

`DC` |  | The device context.
`Bitmap` |  | The bitmap handle.
`StartScan` |  | The first scanline to retrieve.
`NumScans` |  | The number of scanlines to retrieve.
`Bits` |  | Pointer to the color bits array, or Nil to get the BitmapInfo.
`BitInfo` |  | Contains or receives the BitmapInfo.
`Usage` |  | The color format, e.g. DIB_RGB_COLORS.

## Function result

The number of returned scanlines, zero on failure.

## Description

The bitmap must be a compatible (device dependent) bitmap, for the given device context. It should not be selected into any DC.

The color bits are copied into the Bits array in Device Independent Bitmap (DIB) format.

When Bits is Nil, the BitInfo record receives the bitmap information, from which the required size of the Bits array can be determined.

## See also

DIB_RGB_COLORS |  |