void RedrawBackground() { using (FastBitmap bmp = game.LockBits()) { Rectangle r = new Rectangle(0, 0, bmp.Width, bmp.Height); Drawer2DExt.Clear(bmp, r, clearCol); r = new Rectangle(game.Width / 2 - boxWidth / 2, game.Height / 2 - boxHeight / 2, boxWidth, boxHeight); Gradient.Noise(bmp, r, backCol, 4); } }
void DrawTableBackground(FastBitmap dst) { int tableHeight = Math.Max(game.Height - tableY - 50, 1); Rectangle rec = new Rectangle(tableX, tableY, game.Width - tableX, tableHeight); if (!game.ClassicBackground) { PackedCol col = TableView.backGridCol; Drawer2DExt.Clear(dst, rec, col); } else { game.ResetArea(rec.X, rec.Y, rec.Width, rec.Height, dst); } }
public override void Redraw(IDrawer2D drawer) { if (Window.Minimised || !Visible) { return; } using (FastBitmap bmp = Window.LockBits()) { Rectangle r = new Rectangle(X, Y, Width, Height); DrawBoxBounds(bmp, r); DrawBox(bmp, r); r.Width = (int)(Width * Value / MaxValue); Drawer2DExt.Clear(bmp, r, ProgressColour); } }
void DrawBoxBounds(FastBitmap bmp, Rectangle r) { const int border = 1; int y1 = r.Y - border, y2 = y1 + Height + border; r.X -= border; r.Height = border; r.Width += border * 2; r.Y = y1; Drawer2DExt.Clear(bmp, r, boundsTop); r.Y = y2; Drawer2DExt.Clear(bmp, r, boundsBottom); r.Y = y1; r.Width = border; r.Height = y2 - y1; Gradient.Vertical(bmp, r, boundsTop, boundsBottom); r.X += Width + border; Gradient.Vertical(bmp, r, boundsTop, boundsBottom); }
void Clear(FastBitmap bmp, FastColour col, int x, int y, int width, int height) { Drawer2DExt.Clear(bmp, new Rectangle(x, y, width, height), col); }