TLinearGradientRenderer

Hierarchy

   |

TCustomRenderer

   |

TCustomGradientRenderer

uses Image32, Image32_PNG, Image32_vector, Image32_Draw;
  ...
var
  img: TImage32;
  path: TPathD;
  lgr: TLinearGradientRenderer;
begin
  img := TImage32.Create(256,256);
  path := Rectangle(img.Bounds);  
  lgr := TLinearGradientRenderer.Create;
  lgr.SetParameters(PointD(0,0), PointD(256,256), 
    clFuchsia32, $FF3333FF, gfsMirror);
  lgr.InsertColorStop(0.3, clRed32);
  lgr.InsertColorStop(0.4, clYellow32);
  lgr.InsertColorStop(0.5, clYellow32);
  lgr.InsertColorStop(0.7, clLime32);
  lgr.InsertColorStop(0.8, clAqua32);
  DrawPolygon(img, path, frEvenOdd, lgr);
  DrawLine(img, path, 3, clMaroon32, esClosed);
  img.SaveToFile('rainbow_gradient.png');
  rgr.Free;
  img.Free;
end;
            

Reference

Methods
In TLinearGradientRenderer:
Initialize
RenderProc
SetParameters
In TCustomGradientRenderer:
InsertColorStop