java图片如何补余白
重新画一张图,背景设置为白色,尺寸为400*400,在x=0,y=50处插入400*300的图片即可。
java如何给图片补余白
BufferedImage src=ImageIO.read("图片");BufferedImage b=new BufferedImage(src.getWidth(),src.getHeight()+100,src.getType());Graphics2D g2d=b.createGraphics();g2d.setColor(Color.White);g2d.fillRect(0,0,b.getWidth(),b.getHeight());g2d.drawImage(src,0,50);g2d.dispose(...