private void CreateBlock(int row, int col) { _blocks[col, row] = new Common.Shape.Rectangle( GRID_START_LEFT + col * BLOCK_SIZE, GRID_START_TOP + row * BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, Color.Red ); }
public static void Draw(this Graphics g, Common.Shape.Rectangle rectangle) { if (rectangle == null) { throw new System.ArgumentNullException(nameof(rectangle)); } var width = (float)g.CentimeterToPixel(Convert.ToDouble(rectangle.Width)); var height = (float)g.CentimeterToPixel(Convert.ToDouble(rectangle.Height)); g.DrawRectangle(new Pen(Color.Black), 1, 1, width, height); }