BlockTransfer

procedure BlockTransfer(
  Dst: TCustomBitmap32;
  DstX: Integer;
  DstY: Integer;
  DstClip: TRect;
  Src: TCustomBitmap32;
  SrcRect: TRect;
  CombineOp: TDrawMode;
  CombineCallBack: TPixelCombineEvent = nil);

Description

BlockTransfer is similar to the BitBlt function from Windows GDI. It performs copying of a bitmap fragment specified by SrcRect into location (DstX, DstY) with optional alpha blending or using user-specified combining function. This operation is constrained to the DstClip rectangle specified in the destination bitmap coordinates.

If CombineOp=dmOpaque, the fragment simply replaces destination pixels. In dmBlend mode it is blended to destination using its alpha channel and MasterAlpha property. In dmCusom mode, the function calls CombineCallBack function for pixel combining.

It is not required for DstRect and SrcRect to lie entirely inside the corresponding bitmap, since the function provides necessary clipping.

The result is not specified when transferring data inside the same bitmap (Src=Dst) and if in the same time SrcRect intersects with DstRect. In this case it is recommended to use a temporary bitmap buffer.

Neither Src nor Dst bitmaps may be equal to nil. In this case, function will generate an exception. They may be empty however, in this case no transformation will be performed.

This routine used in TCustomBitmap32.Draw and TCustomBitmap32.DrawTo methods.

See Also

TCustomBitmap32, TCustomBitmap32.Draw, TCustomBitmap32.DrawTo, TCustomBitmap32.MasterAlpha, Rectangle Types, TDrawMode, TPixelCombineEvent, StretchTransfer