public MainWindow() : base(Gtk.WindowType.Toplevel) { boardBackground = new ImageSurface("img/board.png"); selectionBorder = new ImageSurface("img/border.png"); PieceDisplay.Init(); Build(); SetPosition(WindowPosition.CenterAlways); }
void RedrawBoard() { boardContext = Gdk.CairoHelper.Create(BoardArea.GdkWindow); double transx = Math.Abs((BoardArea.Allocation.Width - (boardBackground.Width * 0.75))) / 2; boardContext.Translate(transx, 0); boardContext.Scale(0.75, 0.75); boardBackground.Show(boardContext, 0, 0); PieceDisplay.DrawPieces(boardContext); boardContext.Dispose(); }