Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Fading In a label via Animation
Tue, Aug 2 2016 2:30 AMPermanent Link

Richard Mace

Hi All,

I have a label that I have set the Opacity to 100, and am trying to work out how to configure the Animation.Opacity property so that the label "fades in" from Opacity 0 (or 50 would be fine) to 100?  I have set the interval to 500 and have played around with various Styles, but I can't seem to work out how to do a simple "fade in".

If I set the Opacity to 100, then the label just seems to remain at 100, however, if I start the Opacity at 50 and try various styles, I can get it to go from 100 to 50.

Hope that makes sense?

Thanks

Richard
Tue, Aug 2 2016 9:21 AMPermanent Link

Trinione

Richard wrote:
<< ... I can't seem to work out how to do a simple "fade in". >>


Set Animation | Opacity | Style to asLinear.
Tue, Aug 2 2016 9:52 AMPermanent Link

Richard Mace

Trinione wrote:

Richard wrote:
<< ... I can't seem to work out how to do a simple "fade in". >>


< Set Animation | Opacity | Style to asLinear.

I've tried that, but it still doesn't seem to work.
If I set Label.Opacity to 50 and Label.Animations.Opacity.Style to asLinear and interval to 3000 the label fades from 100 to 50 in 3 seconds. If I set the Label.Opacity to 100 it doesn't fade at all? What do I need to set to get it to Animate from 50 to 100?

Thanks

Richard
Tue, Aug 2 2016 12:39 PMPermanent Link

Trinione

<<What do I need to set to get it to Animate from 50 to 100? >>

Richard:

All I did was, at design-time:
1) Label1.Opacity := 50;
2) Label1.Animations.Opacity.Duration := 500;
3) Label1.Animations.Opacity.Style := asLinear;

In Button1 Click event :
4) Label1.Opacity  := 100;

I ran the program, and upon hitting Button1 the opacity faded in accordingly. That's all I did.
Wed, Aug 3 2016 7:45 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Richard,

<< I've tried that, but it still doesn't seem to work.
If I set Label.Opacity to 50 and Label.Animations.Opacity.Style to asLinear and interval to 3000 the label fades from 100 to 50 in 3 seconds. If I set the Label.Opacity to 100 it doesn't fade at all? What do I need to set to get it to Animate from 50 to 100? >>

If you set the Opacity to 100 at design-time, then it won't fade in because it's already 100% opaque (the default state of all UI elements is 100% opacity).  You'll need to set the Opacity to less than 100, and then use the form's OnShow, etc. to set the Opacity to 100.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Aug 3 2016 8:20 AMPermanent Link

Richard Mace

Tim Young [Elevate Software] wrote:

<< If you set the Opacity to 100 at design-time, then it won't fade in because it's already 100% opaque (the default state of all UI elements is 100% opacity).  You'll need to set the Opacity to less than 100, and then use the form's OnShow, etc. to set the Opacity to 100. >>

Thanks Tim and Trinione,
I had missed the fact that I had to set the Opacity to 100, so that the animation could happen.

All working now.

Richard
Image