Quote:
2) You could create the brushes you need before the loop, thus saving the brush construction and destruction;
What can we do if Joseph wants to use 16,777,216 colors? Just :D-ing....
Quote:
1) If the grid is static, i.e. the color reamians the same and a piece is drawn on it, you can create a bitmap in the program initialization, draw the grid to it, and then on the paint, just draw the bitmap before drawing the pieces.
I think this is not faster than drawing the poor grid lines...
Quote:
3) Get the clip region and draw only the rects that interstect with it.
THIS IS THE POINT! A 500x750 grid is big enough to presume that Joseph tries
to draw even outside of the client area.
Anyhow, Joseph, you can take a look here...
http://www.codeguru.com/controls/gridctrl.shtml
and pick a lot of ideas.
EDITED:
---------
Quote:
Originally posted by Mathew Joy
have no intention to become...
Your choice.... Just keep out of MFC discussions. ;)
Quote:
Originally posted by Mathew Joy
Personally, I am against declaring a variable inside the loop, since it only makes the code compiler depended and problematic.
Who said that? Kernighan, Ritchie, or Stroustrup?
I think none of them. :D