By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,870 Members | 1,224 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,870 IT Pros & Developers. It's quick & easy.

Tutorial on Proper Animation

P: n/a
I am looking for a C# .NET 2.0 tutorial on animation techniques,
especially the difficult subject of Invalidating() the smallest possible
area on the screen and the proper way to set things up.
Sep 28 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Martijn Mulder wrote:
I am looking for a C# .NET 2.0 tutorial on animation techniques,
especially the difficult subject of Invalidating() the smallest possible
area on the screen and the proper way to set things up.
I haven't used it yet, but my understanding is that WPF in .NET 3.0
provides a good, high-level animation API that should allow you to not
need to worry about those kinds of specifics.

If you want to do the animation explicitly in .NET without WPF, I think
you may find that the simplest method of maintaining an off-screen
Bitmap into which you do all your drawing and which is then copied to
the screen may work best. If you do it that way, you _might_ want to
track what areas have changed so that only those areas have to be
erased, redrawn, and then copied to the screen, as you mention above.

However -- and I realize this seems a little counter-intuitive -- my
experience has been that your time is better spent ensuring that you can
redraw _everything_ each frame while maintaining sufficient performance,
and then don't worry about minimizing what you redraw.

The reason being that changes in frame rate can be just as problematic
as low frame rate, and so if your code only performs well when it
doesn't have a lot of work to do, it will bog down noticeably during
those moments when a lot of things are changing at once. Drawing,
especially off-screen drawing, is actually very fast these days, and I
think that the exact techniques you're mentioning aren't as relevant as
they once were.

It does depend on exactly what you're animating, but I'd say you should
ignore the partial-redraw issue until you've got a basic implementation,
and are actually seeing some performance problem that mandates that, and
which you aren't able to solve through a better drawing algorithm.

Pete
Sep 28 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.