我想在 JLabel 上制作矩形并将该矩形转换为 BufferedImage ......就像油漆店中的图层......拖动那个 BufferedImage 并调整大小......谁能帮忙
我已经这样做了,但是没有用
Rectangle2D rectangle2D;
BufferedImage bi = new BufferedImage(bimg.getWidth(), bimg.getHeight(), BufferedImage.TYPE_INT_RGB);
Graphics2D big = bi.createGraphics();
rectangle2D = new Rectangle2D.Float(eX, eY, sW, sH);
big.setStroke(new BasicStroke(5));
big.setColor(color);
shapePaint = new TexturePaint(bi, rectangle2D);
g2d.setPaint(shapePaint);