Silverlight: The ultimate introduction to WPF animation (blend 4 Development)

Source: Internet
Author: User

We drew a flying bird. Today we are aiming at a shining sun. Although the animation in this chapter is simple, the effect is not discounted at all.

At first, the sun was shining today. Thanks for your suggestion. If you do not understand, please feel free to ask questions.

Many people say that they can't do it. If you do it yourself, you will find that it is not that difficult. My color scheme is provided. It is quite easy to give it a try.

Our goal is no code, even!

1. Create a New usercontrol in the part folder and name it Sun.

2. Right-click on the outermost layout grid and convert the grid to canvas.

3. Select the elliptical tool and press shift to draw a circle. Fill with gradient (radial gradient ). (0% color # fff6eb08, 42.7% color # fffaef0c, 84.7% color # fffaad0a)

4. Select the Gradient Direction tool to adjust the gradient of the circle. Adjust the location.

5. Add a shadow effect. Click new after effect. Follow the settings.

6. Select a solid color paint brush for stroke.

7. Select the pen tool to draw the sun. Use the pen tool to draw the path and fill it with a linear gradient. Remove the stroke.

8. Use the selection tool to select the path. After the border appears, the center point is pulled to the center of the circle.

9. After adjustment, the copy path will be copied 17 times. Then, select the angle attribute of the path, and add 20.17 paths to each path. Then, the circle is placed in a circle.

10. Select 18 paths and right-click the merged path.

11. Select the gradient tool, set the gradient direction, and change the linear gradient to radial gradient.

For more information about the gradient data, see.

12. Use the pen tool to draw a path larger than the previous path. The steps are the same as the previous path. Draw path, set the gradient Paint Brush, change the gradient mode to linear gradient, and use the gradient tool to adjust the position. (Hide the previous completed path)

13. Repeat steps 8-10 to create the following shape.

14. Change the linear gradient of the path to radial gradient. Then, use the gradient tool to adjust the gradient.

Gradient value I used

15. Turn the second path and adjust the position to form the following shape.

16. After the basic work is completed, start our animation. Today's animation is stroybroad. The new stroybroad is named movesun.

17. Press F6 to enter the Animation Mode.

18. Select the first path, and then set properties such as attributes in the transform category of the property Panel (as long as the value of Z in projection is set to 180)

19. Select the second path and repeat steps 18.

20. Now you can press the preview key to preview the following. Is there a feeling of sunshine.

21. Select movesun and set the repeatbehavior attribute to forever in the property panel on the right.

21. In the last step, let the animation be executed. Open the sun. XAML. CS file in projects and add a code to execute the animation.

22. Finished. Modify the execution file in the app to check the effect. Is it handsome? The sun is shining ......

Now, this chapter is over. Thank you for your support. Please wait for the next round.

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.