AggPas - Anti-Grain Geomertry for Object Pascal

TAgg2D.FillRadialGradient (x, y, r)

Description

This method redefines the physical geometry of already defined radial fill gradient. It's useful when you draw a series of objects 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 stroking 
  VG.NoLine;

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

  // First 3color radial gradient & circle filled with
  VG.FillRadialGradient(50, 50, 40, c1, c2, c3);
  VG.Ellipse(50, 50, 40, 40);

  // Redefine gradient geometry
  VG.FillRadialGradient(105, 105, 30);
  VG.Ellipse(105, 105, 30, 30);

  // Redefine gradient geometry
  VG.FillRadialGradient(150, 150, 20);
  VG.Ellipse(150, 150, 20, 20);

  // Redefine gradient geometry
  VG.FillRadialGradient(180, 180, 10);
  VG.Ellipse(180, 180, 10, 10);

end;

Screenshot: example