[英]How to create an image with rounded corners in Java?
When I draw the BufferedImage with rounded corners 当我绘制带圆角的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));
The output image is: 输出图像是:
How can I receive an image without black cornerns? 如何在没有黑角的情况下收到图像?
更改BufferedImage.TYPE_INT_RGB
到BufferedImage.TYPE_INT_ARGB
创建一个透明图像
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.