当我绘制带有圆角的 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));
输出图像为:
如何接收没有黑角的图像?
最佳答案
将 BufferedImage.TYPE_INT_RGB
更改为 BufferedImage.TYPE_INT_ARGB
以创建透明图像
关于java - 如何在 Java 中创建带圆角的图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31362504/