Re: Graphics ... almost working ... missing one line?
- From: "Peter Webb" <webbfamily@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 9 Dec 2007 03:11:47 +1100
"Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:39B2E477-E187-4736-897A-611A2960FDA3@xxxxxxxxxxxxxxxx
Peter,
What is in the code for play_animation? Are you looping through and repainting on every invocation of the loop? It seems like that is the case here.
What you really want to do is create a timer which you invalidate your picturebox on every tick (the frame rate of your animation will depend on the frequency of the timer).
Yes. I am looping through dozens of on-screen objects, updating their position. That's what my program does, and spends all its time. In the main animation loop, I still use a myBuffer.Render() command, as the drawBox.Invalidate() command flickers (even though it just does a myBuffer.Render() ).
I was told before (and I think by you) to use a timer in asynchronous thread. It didn't seem an issue in my app, as most people will want to run it flat out, so having two threads was more complexity that I didn't understand.
The annoying thing is that it is just a problem at start up of the Form. Everything else works brilliantly.
Is there some quick and dirty I can do for the start-up to make the form appear before the animation starts (or even finishes!)?
Or if I have to do this properly, can you refer me to a web page that might get me started?
.
- Follow-Ups:
- Re: Graphics ... almost working ... missing one line?
- From: Joey Joe Joe
- Re: Graphics ... almost working ... missing one line?
- From: Peter Duniho
- Re: Graphics ... almost working ... missing one line?
- References:
- Graphics ... almost working ... missing one line?
- From: Peter Webb
- Re: Graphics ... almost working ... missing one line?
- From: Nicholas Paldino [.NET/C# MVP]
- Graphics ... almost working ... missing one line?
- Prev by Date: Christmas big ritual
- Next by Date: Re: colordialog.color to int
- Previous by thread: Re: Graphics ... almost working ... missing one line?
- Next by thread: Re: Graphics ... almost working ... missing one line?
- Index(es):
Relevant Pages
|
Loading