我知道如何在Swing中用纯色填充矩形:
Graphics2D g2d = bi.createGraphics();
g2d.setColor(Color.RED);
g2d.fillRect(0,0,100,100);
我知道如何使用图片填充它:
BufferedImage bi;
Graphics2D g2d = bi.createGraphics();
g2d.setPaint (new Color(r, g, b));
g2d.fillRect (0, 0, bi.getWidth(), bi.getHeight());
如何使用大小为100x100的平铺图案来填充大小为950x950的矩形?
(需要使用100次平铺图案)