AggPas - Anti-Grain Geomertry for Object Pascal

TAgg2D.Translate(x, y)

Description

Moves all points of coordinates system in the same direction by a specified distance (shifts the origin of the coordinates system). Translation preserves orientations, distances, ratios and angles.

Parameters

x: double

Shift distance of X axis direction [in subpixels].

y: double

Shift distance of Y axis direction [in subpixels].

Example

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

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

  // First rectangle
  VG.Rectangle(40, 40, 150, 150);

  // Shift by 30 subpixels on X and 10 subpixels on Y
  VG.Translate(30, 10);

  // The same rectangle in a new translated coordinates
  VG.LineColor($FF, $00, $00);
  VG.Rectangle(40, 40, 150, 150);

end;

Screenshot: example