TAgg2D.LineRadialGradient(x, y, r, c1, c2, c3)
Description
Radial line gradient produces equally proportioned circles of colors increasing from the origin to the outer bound.
Gradient's origin (center point) is defined by the x:y couple and the extent of the gradient is defined with radius r.
This gradient variant has a transition consisting of three colors equally distributed from the center point to the outer circle bound.
Radial line gradient is consequently used to fill strokes of objects being drawn. If there is a need to get the filling beyond gradient radius boundary, the c3 color is used as a solid color fill.
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].
c1: TAggColor [*]
First color of the gradient ramp used at center point
[data sructure (r, g, b, a)].
c2: TAggColor [*]
Second color of the gradient ramp used at middle
[data sructure (r, g, b, a)].
c3: TAggColor [*]
Last color of the gradient ramp used at gradient circle bound
[data sructure (r, g, b, a)].
Example
if VG.Attach(Image1.Picture.Bitmap) then begin VG.ClearAll(255, 255, 255); // Turn fill off & set bold line VG.NoFill; VG.LineWidth(15); // Gradient colors Blue - Green - Red c1.Construct($00, $00, $FF); c2.Construct($00, $FF, $00); c3.Construct($FF, $00, $00); // Gradient proceeds from center point // (ClientWidth / 2:ClientHeight / 2) // with extent of (ClientWidth - 30) / 2 VG.LineRadialGradient(ClientWidth / 2, ClientHeight / 2, (ClientWidth - 30) / 2, c1, c2, c3); // Cross lines VG.Line(10, ClientHeight / 2, ClientWidth - 10, ClientHeight / 2); VG.Line(ClientWidth / 2, 10, ClientWidth / 2, ClientHeight - 10); // Rotate +45 degrees VG.Translate(-ClientWidth / 2, -ClientHeight / 2); VG.Rotate(Deg2Rad(45)); VG.Translate(ClientWidth / 2, ClientHeight / 2); // Same cross lines VG.Line(10, ClientHeight / 2, ClientWidth - 10, ClientHeight / 2); VG.Line(ClientWidth / 2, 10, ClientWidth / 2, ClientHeight - 10); end;



