Silverlight3 animation learning transcript

Source: Internet
Author: User

In Silverlight, objects can be animated by applying animations to individual properties of objects.

In Silverlight, you can only perform simple animation processing on properties with a value type of double, color, or point. In addition, you can use objectanimationusingkeyframes to animation other types of attributes, but this requires discrete interpolation (jump from one value to another), which most people think is not true animation.

To apply an animation to an object, create a storyboard object and use targetname and targetproperty to append attributes to specify the objects and attributes to be animated.

To animated attributes that use double values (such as the width attribute of an element), use an animation that generates a double value (doubleanimation. If you want to animation properties that use the point value, use an animation that generates the point value (such as pointanimation.

Silverlight provides two types of Animation: from/to/by animation and key frame animation.

 

 

Animation is a timeline

All animations are inherited from timeline objects, so all animations are dedicated time series. Timeline defines the time period. You can specify the following "Timing Behavior" for a timeline: its duration and repetition times, or even how fast it takes to specify a time series.

Because the animation is timeline, it also represents a time period. When an animation is run within a specified time period (duration) of the animation, the animation calculates the output value. When an animation is running or "played", the animation updates its associated attributes.

Duration, autoreverse, and repeatbehavior are three common timing attributes.

Some of the more interesting Animations (such as rotating, twisting, and re-scaling objects) are implemented by animations on the attributes of the transform object.

 

Easing Function

The easing function allows you to apply a custom arithmetic formula to an animation. For example, you may want an object to bounce back in a realistic way or behave like a spring. You can use a key frame animation or even a from/to/by animation to simulate these effects. However, you may need to do a lot of work and the accuracy of the animation is reduced compared to the arithmetic formula.

In addition to creating your own user-defined easing functions by inheriting from easingfunctionbase, you can also use one of the several easing functions provided during runtime to create common effects.

  • Backease: removes the movement of an animation slightly before it starts to process the animation along the indicated path.

  • Bouncece: create a bounce effect.

  • Circleease: creates an animation that uses cyclic functions to accelerate and/or slow down.

  • Cubicease: create and use FormulasF(T) =T3. Acceleration and/or deceleration animation.

  • Elasticease: creates an animation that indicates the spring oscillates back and forth before it is stopped.

  • Exponentialease: creates an animation that uses an exponential formula for acceleration and/or deceleration.

  • Powerbench: Create a formulaF(T) =TP (where p is equal to the power attribute) the animation for accelerating and/or slowing down.

  • Quadraticease: Create a formulaF(T) =T2. Acceleration and/or deceleration animation.

  • Quarticease: create and use FormulasF(T) =T4. Acceleration and/or deceleration animation.

  • Quinticease: Create a formulaF(T) =T5. Acceleration and/or deceleration animation.

  • Sineease: creates an animation that uses the sine formula for acceleration and/or deceleration.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.