开发者

Problem in moving images in C# [closed]

开发者 https://www.devze.com 2023-02-09 01:41 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.

I asked a question about moving images with timer in c# . Some people said 开发者_运维百科to me to use WPF. But I never worked with WPF before. I looked msdn but don't understand it. Please help me, I really need this soon.


I would suggest you to have a look at Expression Blend video tutorial. Learning and implementing wpf without out tools like Expression Blend is quite challenging. http://expression.microsoft.com/en-us/cc197141.aspx


In short, in WinForms (I assume you use WinWorms when you don't use WPF) to animate some elements on the screen, so the following:

  1. Override the forms OnPaint method, and inside there, draw the image(s) on the desired positions.
  2. Make a backgroundworker tat support sending progress.
  3. In the backgroundworker calculate the new positions, then call ReportProgress.
  4. In the report progress event method, redraw the images on their new positions.
  5. Remember to set the forms DoubleBuffered property to true so that the redrawing is done smoothly.

Good luck! :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号