TImage32.CopyToDc

procedure CopyToDc(dstDc: HDC; x: Integer = 0; y: Integer = 0; transparent: Boolean = true); overload;

procedure CopyToDc(const srcRect: TRect; dstDc: HDC; x: Integer = 0; y: Integer = 0; transparent: Boolean = true); overload;

procedure CopyToDc(const srcRect, dstRect: TRect; dstDc: HDC; transparent: Boolean = true); overload;


Copies the image into a Window's device context

Example

  uses Img32, Img32.Fmt.PNG, BitmapPanels;
  ...
var
  img: TImage32, Img32.Fmt.PNG;
begin
  img := TImage32.Create;
  img.LoadFromResource('Beetle', 'PNG');
  Panel1.Bitmap.Width := img.Width;
  Panel1.Bitmap.Height := img.Height;
  Panel1.ClearBitmap(pf32bit);
  img.CopyToDc(Panel1.Bitmap.Canvas.Handle);
  img.Free;