Search code examples
delphifiremonkey

How to create animation with scale property in firemonkey


I have an image with align:=client and scale.X:=0,5 and scale.Y:=0,5 and wrapmode:=Center

I have created a TFloatAnimation on Scale.X and Scale.Y properties with these properties:

AnimationType:=in
duration:=0,2
Enabled:=true
Interpolation:=linear
StartFromCurrent:=true
StopValue:=1

but when the animation begins it works and the scale changes from 0,5 to 1, but the image position changes from the center to the bottom left of the form.

Is there anything wrong, how could I do it?


Solution

  • Without understanding what is going on behind the FMX scenes (no pun intended), it seems you can solve this by adding an OnProcess handler to one of your animations and filling the handler with yourImageControl.RecalcSize()