AggPas - Anti-Grain Geomertry for Object Pascal

TAgg2D.LineRadialGradient(x, y, r)

Description

This method redefines the physical geometry of already defined radial line gradient. It's useful when you draw a series of objects with strokes filled with seemingly own radial gradients based on the same color ramp.

Parameters

x: double

X coordinate of gradient center point [in subpixels].

y: double

Y coordinate of gradient center point [in subpixels].

r: double

Radius of gradient outer bound circle [in subpixels].

Example

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

  VG.ClearAll(255, 255, 255);

  // Turn off fill & set bold line
  VG.NoFill;
  VG.LineWidth(20);

  // Gradient colors Blue - Yellow - Red
  c1.Construct($00, $00, $FF);
  c2.Construct($FF, $FF, $00);
  c3.Construct($FF, $00, $00);

  // First 3color radial gradient & circle filled with
  VG.LineRadialGradient(20, 30, 120, c1, c2, c3);
  VG.Line(20, 30, 120 + 20, 30);

  // Redefine gradient geometry
  VG.LineRadialGradient(70, 90, 100);
  VG.Line(70, 90, 100 + 70, 90);

  // Redefine gradient geometry
  VG.LineRadialGradient(110, 150, 80);
  VG.Line(110, 150, 80 + 110, 150);

end;

Screenshot: example