抗锯齿的代码我倒是有一个,你试一下,输出图片第一行是不抗锯齿的,第二行是抗锯齿的。
public static void main(String[] args) throws IOException {
BufferedImage image = new BufferedImage(400, 200, BufferedImage.TYPE_4BYTE_ABGR_PRE);
Graphics2D g2d = image.createGraphics();
g2d.setColor(Color.WHITE);
g2d.fillRect(0, 0, 400, 200);
g2d.setColor(Color.BLACK);
g2d.setFont(new Font("Arial", Font.PLAIN, 37));
g2d.drawString("jjyygg789@163.com", 10f, 40f);
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);// 设置抗锯齿效果
g2d.drawString("jjyygg789@163.com", 10f, 80f);
File outputfile = new File("D:\\TestGraphics.png");
ImageIO.write(image, "PNG", outputfile);
}
请问您是怎么解决的这个问题啊