Simple animation using C#/Windows Forms

后端 未结 2 694
星月不相逢
星月不相逢 2020-11-27 10:31

I need to knock out a quick animation in C#/Windows Forms for a Halloween display. Just some 2D shapes moving about on a solid background. Since this is just a quick one-o

相关标签:
2条回答
  • 2020-11-27 11:07

    2d Game Primer

    Timer Based Animation

    Both of these give good examples of animation. The code is fairly straightforward. i used these when I needed to do a quick animation for my son.

    0 讨论(0)
  • 2020-11-27 11:22

    Set off a timer at your desired frame rate. At each timer firing twiddle the internal representation of the shapes on the screen (your model) per the animation motion you want to achieve, then call Invalidate(true). Inside the OnPaint just draw the model on the screen.

    Oh yeah, and you probably want to turn Double Buffering on (this is like automatic page flipping).

    0 讨论(0)
提交回复
热议问题