//生成黑色底图public static void pureColorPictures(String width,String height ) {//width 生成图宽度// height 生成图高度//创建一个width xheight ,RGB高彩图,类型可自定BufferedImage img=new BufferedImage(width, height , BufferedImage.TYPE_INT_RGB);//取得图形Graphics g=img.getGraphics();//设置颜色g.setColor(Color.BLACK);//填充g.fillRect(0, 0, img.getWidth(), img.getHeight());//在d盘创建个文件File file=new File("D:/job/image/top.jpg");try{//以png方式写入,可改成jpg其他图片ImageIO.write(img, "jpg", file);}catch (IOException e){e.printStackTrace();}
1200字范文,内容丰富有趣,写作的好帮手!