schmintan

schmintan

  • NA
  • 64
  • 0

severe flicker when creating moving image on a panel

Feb 28 2005 4:06 PM
i have a panel on a form onto which im drawing a little moving simulation. i had this working perfectly , flicker free on the form, but when i tried to put it on the panel it is terrible. i have overridden the panel_OnPaint() method to this: [CODE] private void Pannel_Paint(object sender, System.Windows.Forms.PaintEventArgs g) {//top walls g.Graphics.FillRectangle(Brushes.Cyan,1,1,this.Width,this.Height); foreach (Wall w in this.walls) { w.DrawWall(g.Graphics); } crowd.DrawToScreen(g.Graphics); panel1.Invalidate(); } [/CODE] i have the doubble buffering set up here [CODE] SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); [/CODE] i have overridden the onPaintBackground() to do nothing. i have tried overriding and leaving the form1_onPaint() but still the same problem happens. any ideas on what i can do now?