Sign in Join
FPDoc Onlineexperiment

TWidgetSet.BitBlt function

Member of TWidgetSetpublicIn unit InterfaceBase

Copies part of a source DC into a destination DC, using the specified raster operation.

Declaration

pascal
function BitBlt(DestDC: HDC; X: Integer; Y: Integer; Width: Integer; 
 Height: Integer; SrcDC: HDC; XSrc: Integer; 
 YSrc: Integer; Rop: DWORD): Boolean; virtual

Description

This routine implements the equivalent Windows GDI API of the same name in all platforms supported by Lazarus.

It copies a section of a Canvas to another one, without any stretching. It allows one to select the kind of operation which should be performed to draw the pixels into the destination in the parameter ROP. Allowed operations go from simply copying the pixels without change to inverting them and also to executing logical operations involving the source pixels and the previously existing pixels in the destination Canvas.

For normal usage one should only use SRCOPY in the ROP parameter, other operations may not be supported by all widgetsets.

There exist 16 raster operations, according to the possible combinations of two (boolean) values. Excluding the NOP case, that doesn't modify the target area, the possible values for ROP are:

  • BLACKNESS - Fills the destination rectangle with black
  • DSTINVERT - Inverts the colors of the destination area
  • MERGECOPY -
  • MERGEPAINT -
  • NOTSRCCOPY -
  • NOTSRCERASE -
  • PATCOPY -
  • PATINVERT -
  • PATPAINT -
  • SRCAND -
  • SRCCOPY -
  • SRCERASE -
  • SRCINVERT -
  • SRCPAINT - Combines the colors of the source and the destination using the operator OR on each pixel
  • WHITENESS - Fills the destination rectangle with white

These flags can be added to above ROPs:

CAPTUREBLT
Includes windows which are on top of the specified Canvas. This option is not recommended and is very hard to implement in all supported platforms.
NOMIRRORBITMAP
Prevents the bitmap from being mirrored. (The coordinates are sorted before painting?)

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.