473,387 Members | 1,291 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Tutorial on Proper Animation

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
1 3412
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: Xah Lee | last post by:
i've started to read python tutorial recently. http://python.org/doc/2.3.4/tut/tut.html Here are some quick critique: quick example: If the input string is too long, they don't truncate it,...
5
by: Brian Angliss | last post by:
I'm relatively new to scripting in JavaScript, so I'm not too surprised I'm having difficulty scripting up an animation effect for my personal site. What I'm trying to do is the following: When...
6
by: Darren | last post by:
X-No-Archive Hi all, Can anyone help me with structuring the data in a small tool I have to build? I'm trying to work out if there's a design pattern or data structure that would remove some...
7
by: bbercik | last post by:
Hey Everybody, I have created an XMLHttpRequest tutorial that uses baby steps to walk you through the XMLHttpRequestJavaScript object. It includes a functional example that retrieves the city...
11
by: Magnus Lycka | last post by:
While the official Python Tutorial has served its purpose well, keeping it up to date is hardly anyones top priority, and there are others who passionately create really good Python tutorials on...
2
by: rdemyan via AccessMonster.com | last post by:
My application has a lot of complicated SQL statements, calculations, processing that takes time. I've created a custom form to act like a messagebox. It has 10 small rectangles on it that change...
1
by: xahlee | last post by:
Elisp Tutorial: Make Google Earth Xah Lee, 2006-12 This page shows a example of writing a emacs lisp function that creates a Google Earth file, and creates a link to the file, as well a link...
4
by: Sin Jeong-hun | last post by:
Most applications, including Windows Explorer, show some sort of 'wait' dialog with animation when a lengthy operation is going on. For example, When the Windows Explorer is searching for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.