Figure 1 - Cartwheel Man in Action
This simple application illustrates how GraphicsPaths can be animated to look like something is moving across the screen. Below is the simple design for the cartwheel program:
Figure 2 - UML Design reverse engineered using WithClass 2000 C# Design Tool
All of the GraphicsPath manipulation is done in the Figure Class. The Graphics path stick figure is originally created in the constructor. When you create a GraphicsPath stick figure, you need to backtrack on lines you don't want connected, otherwise the program will add lines to fill the path. At the end of our constructor we also do some initial scaling and translation of our stick figure to shrink him and put him more in the center of the screen.
A Restart button has also been added to allow you to restart the figure anytime through the cartwheel cycle. This button calls the Figure Class's Reset method to reset the transformation matrices and restart the timer.
Also worth noting is the double buffering in the form. To reduce flickering the following lines were added in the constructor of the form.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: