示例#1
0
 public MainWindow() : base(Gtk.WindowType.Toplevel)
 {
     boardBackground = new ImageSurface("img/board.png");
     selectionBorder = new ImageSurface("img/border.png");
     PieceDisplay.Init();
     Build();
     SetPosition(WindowPosition.CenterAlways);
 }
示例#2
0
        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();
        }