I am currently working on a grid-based game for the VB.Net Compact Framework in VB.Net 2003. In order to minimize the footprint, I am using a grid drawn courtesy of GDI+. It works very well; it is small, and is fast (once I got the double-buffering working like I wanted). However, I've run into a new snag that I am trying to work out. I have a panel control that basically provides the graphics object to the class responsible for rendering the grid. I invalidate the grid, which fires the paint event...which in turn passes the graphics object (remember this is the graphics object that relates specifically to the object on which I want to paint). I am also going to work on a method by which I invalidate only a region of the grid to reduce processor stress, but first things first. This all seems to work fine, except for this: the paint event gets called twice on the invalidate. This makes the grid flash. I am using the directional buttons on the emulator to control the grid; I can't help but wonder if perhaps this invalidates the whole form, which in turn repaints the grid. My guess is that something is, and that's from where it is coming.
I'll update with an answer when I find it, and oh I will...I'll include some code once I get it straightened out.
posted @ Thursday, June 02, 2005 7:15 AM