当我绘制带圆角的BufferedImage时
BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
Graphics2D graphics = image.createGraphics();
graphics.setColor(Color.WHITE);
graphics.fill(new RoundRectangle2D.Float(0, 0, 60, 60, 20, 20));
输出图像是:
如何在没有黑角的情况下收到图像?
答案 0 :(得分:4)
将BufferedImage.TYPE_INT_RGB
更改为BufferedImage.TYPE_INT_ARGB
以创建透明图像