package edu.com;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
public class demo2 {
public static void main(String[] args) throws IOException {
int width=300;
int height=200;
File file=new File("c://make.jpg");//没有就新建
BufferedImage big=new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
Graphics g=(Graphics)big.getGraphics();
g.setColor(Color.gray);
g.fillRect(20,60, width, height);
g.setColor(Color.red);
g.drawString("janely Test.haha!!!", 45, 45);
g.drawString("i'm here..into", 100, 120);
ImageIO.write(big, "jpg", file);
System.out.println(" succss...");
}
}