Canvas: How to get a circular gradient?

Viewed 214

Is there a way to draw an Arc with circular gradient in Firemonkey (10.3)? I tried the following code, but this gives me "green-red-green" instead of "green-red".

with PaintBox1.Canvas do
begin
  BeginScene;

  Stroke.Kind := TBrushKind.Gradient;
  Stroke.Thickness := 20;
  Stroke.Cap := TStrokeCap.Round;
  Stroke.Gradient.Style := TGradientStyle.Linear;
  Stroke.Gradient.Color := TAlphaColors.Green;
  Stroke.Gradient.Color1 := TAlphaColors.Red;

  DrawArc(PointF(250,250),PointF(100,100),-250,320,1);

  EndScene;
end;

The result is:

enter image description here

0 Answers
Related