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); }
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); } }