TImage32.CopyFromDC

procedure CopyFromDC(srcDc: HDC; const srcRect: TRect);

Copies an image from a Window's device context, erasing the current image in TImage32.

Example

  uses VCL.Graphics, Img32;
  ...
var
  img: TImage32;
  bmp: TBitmap;
begin
  ...
  img := TImage32.Create;
  img.CopyFromDC(bmp.Canvas.Handle, Rect(0, 0, bmp.Width, bmp.Height));
  ...
  img.Free;