import org.hedgecode.chess.position.Square;
/**
- *
+ * Builder for chess diagrams.
*
* @author Dmitry Samoshin aka gotty
*/
int squareSize = board.squareSize();
- BufferedImage image = board.render();
+ BufferedImage image = board.getBoard();
Graphics imageGraphics = image.getGraphics();
for (int y = 0; y < Square.getSize(); ++y) {
for (int x = 0; x < Square.getSize(); ++x) {
imageGraphics.drawImage(
pieces.get(colorPiece).getScaledInstance(
squareSize, squareSize, Image.SCALE_SMOOTH
- ),
+ ), // todo: scale in other place
x * squareSize,
y * squareSize,
null
ImageIO.write(
DiagramBuilder.getInstance().build(
- Positions.INITIAL.getPosition(), "test", "shade"
+ Positions.INITIAL.getPosition(), "test", "chess24"
).getImage(),
ImageFormat.PNG.name(),
new File("chessboard" + "." + ImageFormat.PNG.getExt())