Exemple #1
0
        public Image RenderBoard()
        {
            LeeBitmap leeBitmap = new LeeBitmap(BoardSize);

            leeBitmap.RenderBackGround();
            for (int i = 0; i < 19; i++)
            {
                leeBitmap.DrawVerLine(i * interval + startX, startY, lineLength);
                leeBitmap.DrawHorLine(startX, i * interval + startY, lineLength);
                if (i == 3 || i == 9 || i == 15)
                {
                    leeBitmap.DrawCircle(startX + i * interval - starOffset, startY + 3 * interval - starOffset, interval / 4);
                    leeBitmap.DrawCircle(startX + i * interval - starOffset, startY + 9 * interval - starOffset, interval / 4);
                    leeBitmap.DrawCircle(startX + i * interval - starOffset, startY + 15 * interval - starOffset, interval / 4);
                }
            }
            for (int i = 0; i < 19; i++)
            {
                for (int j = 0; j < 19; j++)
                {
                    if (goLogical.allPoints[i, j] != POINTSTATUS.EMPTY)
                    {
                        DrawPiece(leeBitmap, i, j, goLogical.allPoints[i, j]);
                    }
                }
            }
            if (bestMoves != null)
            {
                int index = 0;
                bestMoves.ForEach(delegate(MoveData md)
                {
                    DrawBestMove(leeBitmap, md.coordinate, md.winrate, index);
                    index++;
                });
            }
            if (CrossCoord != null)
            {
                DrawCross(leeBitmap, startX - pieceSize / 2 + CrossCoord[0] * interval, startY - pieceSize / 2 + CrossCoord[1] * interval, interval);
            }
            return(leeBitmap.BP);
        }
Exemple #2
0
 private void DrawBestMove(LeeBitmap leeBitmap, string coordinate, double winrate, int index)
 {
     int[] coord = convertNameToCoordinates(coordinate);
     if (coord != null)
     {
         Color _colorEdge    = Color.Blue;
         Color _colorContent = Color.MediumSpringGreen;
         if (index == 0)
         {
             _colorEdge    = Color.Red;
             _colorContent = Color.DarkOrange;
         }
         else if (index == 1)
         {
             _colorEdge    = Color.DeepPink;
             _colorContent = Color.GreenYellow;
         }
         leeBitmap.DrawCircleLine(startX - pieceSize / 2 + coord[0] * interval, startY - pieceSize / 2 + coord[1] * interval, pieceSize + 1, _colorEdge);
         leeBitmap.DrawCircle(startX - pieceSize / 2 + coord[0] * interval, startY - pieceSize / 2 + coord[1] * interval, pieceSize, _colorContent);
         leeBitmap.DrawString(startX - pieceSize / 2 + coord[0] * interval, startY - pieceSize / 2 + coord[1] * interval, winrate.ToString(), interval / 2, interval / 2 * 1.5f);
     }
 }
Exemple #3
0
 public void DrawPiece(LeeBitmap leeBitmap, int x, int y, POINTSTATUS pIECECOLOR = POINTSTATUS.BLACK)
 {
     leeBitmap.DrawPiece(startX - pieceSize / 2 + x * interval, startY - pieceSize / 2 + y * interval, pieceSize, pIECECOLOR == POINTSTATUS.BLACK?Color.Black: Color.White);
     //leeBitmap.DrawArc(startX - pieceSize / 2, startY - pieceSize / 2, pieceSize - 2, pieceSize - 2, Color.White);
 }
Exemple #4
0
 private void DrawCross(LeeBitmap lp, int x, int y, int rad)
 {
     lp.DrawCross(x, y, rad);
 }