private void frmGame_Paint(object sender, PaintEventArgs e) { Graphics g = this.CreateGraphics(); Color col; if (Properties.Settings.Default.RainbowMode) { Random rand = new Random(); byte red, green, blue; red = (byte)rand.Next(0, 255); green = (byte)rand.Next(0, 255); blue = (byte)rand.Next(0, 255); col = Color.FromArgb(red, green, blue); } else { col = Color.FromArgb(Properties.Settings.Default.colorR, Properties.Settings.Default.colorG, Properties.Settings.Default.colorB); } SolidBrush pen = new SolidBrush(col); g.FillEllipse(pen, gdicirclex, gdicircley, gdicirclewidth, gdicircleheight); g.FillRectangle(pen, gdiuser1x, gdiuser1y, gdiuser1width, gdiuser1height); g.FillRectangle(pen, gdiuser2x, gdiuser2y, gdiuser2width, gdiuser2height); PInvoke.LockWindowUpdate(IntPtr.Zero); }
private void tmUpdate_Tick(object sender, EventArgs e) { Invalidate(); // Not known if needed: // Update(); frames++; PInvoke.LockWindowUpdate(this.Handle); }