AggPas - Anti-Grain Geomertry for Object Pascal

TAgg2D.TransformImage(bitmap, dstX1, dstY1, dstX2, dstY2)

Description

Draws a TBitmap image at defined target surface rectangle.

Parameters

bitmap: TBitmap

Reference to non empty pf32bit TBitmap (or descendant).

dstX1: double

X coordinate of target surface rectangle Top Left corner [in subpixels].

dstY1: double

Y coordinate of target surface rectangle Top Left corner [in subpixels].

dstX2: double

X coordinate of target surface rectangle Bottom Right corner [in subpixels].

dstY2: double

Y coordinate of target surface rectangle Bottom Right corner [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 Lena image around own axis
  VG.Translate(-(50 + Image2.Picture.Bitmap.Width / 2),
   -(150 + Image2.Picture.Bitmap.Height / 2));
  VG.Rotate(Deg2Rad(TrackBar1.Position));
  VG.Translate((50 + Image2.Picture.Bitmap.Width / 2),
   (150 + Image2.Picture.Bitmap.Height / 2));

  // Draw the bitmap
  VG.TransformImage(Image2.Picture.Bitmap,
   50, 150, Image2.Picture.Bitmap.Width + 50, Image2.Picture.Bitmap.Height + 150);

end;

Screenshot: example