static void DrawSlowPixel(int x, int y, Couleur c) { Color cc = c.Convertion(); B.SetPixel(x, y, cc); Program.MyForm.PictureBoxInvalidate(); nb_pix++; if (nb_pix > refresh_every) // force l'affichage à l'écran tous les 1000pix { Program.MyForm.PictureBoxRefresh(); nb_pix = 0; } }
/// ///////////////// public methods /////////////////////// public static void RefreshScreen(Couleur c) { if (Program.MyForm.Checked()) { Mode = ModeAff.SLOW_MODE; Graphics g = Graphics.FromImage(B); Color cc = c.Convertion(); g.Clear(cc); } else { Mode = ModeAff.FULL_SPEED; data = B.LockBits(new Rectangle(0, 0, B.Width, B.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb); stride = data.Stride; for (int x = 0; x < Largeur; x++) for (int y = 0; y < Hauteur; y++) DrawFastPixel(x, y, c); } }
/// ///////////////// public methods /////////////////////// static public void RefreshScreen(Couleur c) { if (Program.MyForm.Checked()) { Mode = ModeAff.SLOW_MODE; Graphics g = Graphics.FromImage(B); Color cc = c.Convertion(); g.Clear(cc); } else { Mode = ModeAff.FULL_SPEED; data = B.LockBits(new System.Drawing.Rectangle(0, 0, B.Width, B.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb); stride = data.Stride; for (int x = 0; x < Largeur; x++) { for (int y = 0; y < Hauteur; y++) { DrawFastPixel(x, y, c); } } } }
static void DrawSlowPixel(int x, int y, Couleur c) { Color cc = c.Convertion(); B.SetPixel(x, y, cc); Program.MyForm.PictureBoxInvalidate(); nb_pix++; if (nb_pix > refresh_every) // force l'affichage à l'écran tous les 1000pix { Program.MyForm.PictureBoxRefresh(); nb_pix = 0; } }