当执行慢动画时,这尤其引人注目,其中位置(X和Y),宽度和高度同时被动画化,从而产生缩放效果.圆圈的左上部和上部平滑向外,而右侧和底部部分是生涩的.
无法弄清楚为什么会这样.所有建议都非常感谢.
(顺便说一句,当Scale.X和Scale.Y被动画化时不会发生这种情况.平滑.但我不希望笔划粗细缩放,因此使用宽度和高度)
(使用XE2)
一些TForm代码演示:
object Form6: TForm6 left = 0 top = 0 Caption = 'Form6' ClIEntHeight = 821 ClIEntWIDth = 1108 Visible = False StyleLookup = 'backgroundstyle' object cirpulse: TCircle position.Point = '(352,192)' WIDth = 200.000000000000000000 Height = 200.000000000000000000 Fill.Kind = bkNone strokeThickness = 10.000000000000000000 object floatAnimation1: TfloatAnimation Enabled = True Duration = 50.000000000000000000 StartFromCurrent = True StopValue = 400.000000000000000000 Propertyname = 'WIDth' end object floatAnimation2: TfloatAnimation Enabled = True Duration = 50.000000000000000000 StartFromCurrent = True StopValue = 400.000000000000000000 Propertyname = 'Height' end object floatAnimation3: TfloatAnimation Enabled = True Duration = 50.000000000000000000 StartFromCurrent = True StopValue = 252.000000000000000000 Propertyname = 'position.X' end object floatAnimation4: TfloatAnimation Enabled = True Duration = 50.000000000000000000 StartFromCurrent = True StopValue = 92.000000000000000000 Propertyname = 'position.Y' end endend解决方法 到目前为止,我似乎已经解决了这个问题,通过更改FMX.Types单元中的以下行,
function FitRect(var R: TRectF; BoundsRect: TRectF): Single;
更改
if ratio < 1 thenbegin R := RectF(0,RectWIDth(R),RectHeight(R));endelsebegin R := RectF(0,round(RectWIDth(R) / ratio),round(RectHeight(R) / ratio));end;
成
if ratio < 1 thenbegin R := RectF(0,RectWIDth(R) / ratio,RectHeight(R) / ratio);end;
因此,摆脱回合.
还没有足够的测试来发现副作用.
总结以上是内存溢出为你收集整理的delphi – 在动画TCircle的宽度时如何获得平滑的子像素动画?全部内容,希望文章能够帮你解决delphi – 在动画TCircle的宽度时如何获得平滑的子像素动画?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)