TImage32.CopyToDc

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

Copies the image into a Window's device context

Example

  uses Image32, Image32_PNG, BitmapPanels;
  ...
var
  img: TImage32, Image32_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, 0, 0, transparent);
  img.Free;