AggPas - Anti-Grain Geomertry for Object Pascal

TAgg2D.CopyImage(bitmap, dstX, dstY)

Description

Draws a whole TBitmap image at defined coordinates.

This method is just raw image data copier, so affine transformations of coordinate system doesn't apply to the image data (only destination coordinates are transformed).

Parameters

bitmap: TBitmap

Reference to non empty pf32bit TBitmap (or descendant).

dstX: double

X coordinate of target point on surface to copy image to [in subpixels].

dstY: double

Y coordinate of target point on surface to copy image to [in subpixels].

Example

// Cut and paste this into the tagg2d_example08.zip

if VG.Attach(Image1.Picture.Bitmap) then begin

  VG.ClearAll(255, 255, 255, 0);

  // Setting master parameters
  VG.MasterAlpha(TrackBar2.Position / 255);
  VG.AntiAliasGamma(TrackBar3.Position / 10);
  VG.BlendMode(BM);

  // Rotate coordinates system around own axis
  VG.Translate(-ClientWidth / 2, -ClientHeight / 2);
  VG.Rotate(Deg2Rad(TrackBar1.Position));
  VG.Translate(ClientWidth / 2, ClientHeight / 2);

  // Copy a portion of Image
  VG.CopyImage(Image2.Picture.Bitmap, 50, 150);

end;

Screenshot: example