使用Graphics2D绘图结果如下:
文字周边非常模糊。想要效果是:
请问如何使用java实现这种清晰的绘制文字的效果呢?
更新
代码如下:
public static void pressText(String targetImg, String pressText, String fontName, int fontStyle, int fontSize, Color color) {
try {
File file = new File(targetImg);
Image image = ImageIO.read(file);
int width = image.getWidth(null);
int height = image.getHeight(null);
BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D g = bufferedImage.createGraph