TAgg2D.TransformImage(bitmap, imgX1, imgY1, imgX2, imgY2,
dstX1, dstY1, dstX2, dstY2)
Description
Draws a TBitmap image at defined target surface rectangle, while getting the image data from defined source image rectangle.
Parameters
bitmap: TBitmap
Reference to non empty pf32bit TBitmap (or descendant).
imgX1: integer
X coordinate of source image data Top Left corner [in pixels].
imgY1: integer
Y coordinate of source image data Top Left corner [in pixels].
imgX2: integer
X coordinate of source image data Bottom Right corner [in pixels].
imgY2: integer
Y coordinate of source image data Bottom Right corner [in pixels].
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, 60, 40, Image2.Picture.Bitmap.Width - 60, Image2.Picture.Bitmap.Height - 60, 50, 150, Image2.Picture.Bitmap.Width + 50, Image2.Picture.Bitmap.Height + 150); end;



