locked
Direct draw handle RRS feed

  • Question

  • I have a direct draw handle that i need to draw a rectangle to. but in c# the drawing is done on the paint events. How can I draw using a directdraw handle?
    Monday, September 4, 2006 8:26 PM

Answers

  • No I am not working on a game but I found the answer.

    Graphics g = Graphics.FromHDC(...);
    Wednesday, September 6, 2006 6:56 PM

All replies

  • Technically, you don't need to use the Paint event.  Sounds like you're working on some kind of game, you probably have a main loop where you generate scenes at a rate of (hopefully) no less than 30 per second.  Just blast your rectangle to the screen, don't wait until Windows tells you it is ready to paint...
    Monday, September 4, 2006 9:39 PM
    Moderator
  • No I am not working on a game but I found the answer.

    Graphics g = Graphics.FromHDC(...);
    Wednesday, September 6, 2006 6:56 PM