java创建一张图片Demo,主要代码: int width = 200, height = 250; //创建图片对象 BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR); //基于图片对象打开绘图 Graphics2D graphics = image.createGraphics(); //绘制圆形 graphics.setColor(Color.BLUE); Ellipse2