FMX 做一个带动画的虚线边框

欢迎加入全网最大Delphi 技术交流群 682628230

效果如图所示:

H3NGozVO

 

Rectangle1.Stroke.Kind := TBrushKind.Solid;
  Rectangle1.Stroke.Dash := TStrokeDash.Dash;
  Rectangle1.Stroke.Color := TAlphaColors.Red;
  Rectangle1.Stroke.Thickness := 2;

procedure TForm3.FormShow(Sender: TObject);
begin
  FloatAnimation1.Parent := Rectangle1;
  FloatAnimation1.PropertyName := 'Stroke.Thickness';
  FloatAnimation1.StartValue := 0;
  FloatAnimation1.StopValue := 5;
  FloatAnimation1.Duration := 1;
  FloatAnimation1.Loop := True;
  FloatAnimation1.AnimationType := TAnimationType.InOut;
  FloatAnimation1.Interpolation := TInterpolationType.Linear;
  FloatAnimation1.Start;
end;
© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享