schmintan

schmintan

  • NA
  • 64
  • 0

drawing everything before drawing to the screen

Mar 1 2005 5:51 AM
i have created my own draw method to draw moving items to the screen. this is run from inside a thread. i get awaul flicker, which can be kinda controlled by adjusting the sleep time of the thread, but this is not fully effective. is there anyway to draw the full image to something ( a bitmap or some image object) before drawing this to the form? i dont think the built in doubble buffering is working as im not using the Form_OnPaint() method. SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); any ideas on how to completely rid myself of flicker. heres my paint method. private void DrawToScreen(Graphics g) { g.FillRectangle(Brushes.Cyan,1,1,this.Width,this.Height); foreach (Wall w in this.walls) { w.DrawWall(g); } crowd.DrawToScreen(g); }

Answers (5)