画布:如何获得圆形渐变?

时间:2019-10-19 15:21:25

标签: delphi canvas firemonkey

是否有办法在Firemonkey(10.3)中绘制具有圆形渐变的弧? 我尝试了以下代码,但这使我获得了“绿色-红色-绿色”而不是“绿色-红色”。

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;

结果是:

enter image description here

0 个答案:

没有答案
相关问题