有分就赚,毫不客气,呵呵。很简单,首先把图片读入内存。 ImageIcon img = new ImageIcon("file name"); BufferedImage bi = (BufferedImage)img.getImage(); Graphics2D big = bi.createGraphics();gib.drawString("string", xpos, ypos);BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream("another file name"));// ImageIO支持对BMP、JPEG的读写,对GIF文件目前只能读。 ImageIO.write(bi, "jpeg", out);out.close();有关Java Image API的详情,参考 Programmer's Guide to the JavaTM 2D API -- Chapter 5 Imaging <http://blog.csdn.net/unagain/archive/2006/05/04/707566.aspx>
http://www.mexiu.com/album/index.html
里面动态合成参考的java 的 gif类
ImageIcon img = new ImageIcon("file name");
BufferedImage bi = (BufferedImage)img.getImage();
Graphics2D big = bi.createGraphics();gib.drawString("string", xpos, ypos);BufferedOutputStream out =
new BufferedOutputStream(
new FileOutputStream("another file name"));// ImageIO支持对BMP、JPEG的读写,对GIF文件目前只能读。
ImageIO.write(bi, "jpeg", out);out.close();有关Java Image API的详情,参考
Programmer's Guide to the JavaTM 2D API -- Chapter 5 Imaging <http://blog.csdn.net/unagain/archive/2006/05/04/707566.aspx>