Thread: A slow drawing problem

  1. #16
    Registered User gavra's Avatar
    Join Date
    Jun 2008
    Posts
    265
    It's in Hebrew but I wrote instructions in there.
    2shared - download p.zip
    Thanks.
    gavra.

  2. #17
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    I got rid of the flicker by changing 2 lines in FormGame_Paint() and setting FormGame's DoubleBuffered property to true.

    Line 438 in FormGame.cs I changed from:
    Code:
    playingField = new Bitmap(Globals.PlaygroundWIDTH, Globals.PlaygroundHEIGHT, graphics);//create an image the same size as the screen
    To...
    Code:
    playingField = new Bitmap(Globals.PlaygroundWIDTH, Globals.PlaygroundHEIGHT, e.Graphics);//create an image the same size as the screen
    Line 455 of FormGame.cs I changed from:
    Code:
    graphics.DrawImage(playingField, new Point(0, 0));
    To...
    Code:
    e.Graphics.DrawImage(playingField, new Point(0, 0));
    And then set FormGame.DoubleBuffered to True in the design view of FormGame.cs.

    P.S. Good thing you added those instructions. I was totally lost! Heh.
    If you understand what you're doing, you're not learning anything.

  3. #18
    Registered User gavra's Avatar
    Join Date
    Jun 2008
    Posts
    265
    WOW! Thank you!
    I would be happy if I will also understand what's the difference between FormGame.CreateGraphics() and e.Graphics objects.
    gavra.

  4. #19
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    You fall in the first category

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Which is the better way to draw?
    By g4j31a5 in forum Game Programming
    Replies: 16
    Last Post: 01-22-2007, 11:56 PM
  2. draw function HELP!!!
    By sunoflight77 in forum C++ Programming
    Replies: 1
    Last Post: 05-10-2005, 11:28 PM
  3. ray casting
    By lambs4 in forum Game Programming
    Replies: 62
    Last Post: 01-09-2003, 06:57 PM
  4. Draw Shapes.
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 08-19-2002, 09:22 AM
  5. Transparent Draw Question
    By GodLike in forum Windows Programming
    Replies: 5
    Last Post: 05-07-2002, 06:56 AM