获取图像的图形对象,将当前绘画设置为所需的颜色,然后调用
fillRect(0,0,width,height)。
BufferedImage b_img = ...Graphics2D graphics = b_img.createGraphics();graphics.setPaint ( new Color ( r, g, b ) );graphics.fillRect ( 0, 0, b_img.getWidth(), b_img.getHeight() );

获取图像的图形对象,将当前绘画设置为所需的颜色,然后调用
fillRect(0,0,width,height)。
BufferedImage b_img = ...Graphics2D graphics = b_img.createGraphics();graphics.setPaint ( new Color ( r, g, b ) );graphics.fillRect ( 0, 0, b_img.getWidth(), b_img.getHeight() );