简单图片加文字

File file =new File("E:\\IDEA\\scripttest\\src\\main\\resources\\timg.jpg");
BufferedImage image = ImageIO.read(file);
Graphics graphics =image.getGraphics();
graphics.setFont(new Font("",Font.BOLD,250));
graphics.setColor(Color.red);
graphics.drawString("hello world!",300,300);
File file2 =new File("copy.jpg");
ImageIO.write(image,"JPEG",file2);
posted @ 2018-05-15 12:40  山神笔记  阅读(141)  评论(0编辑  收藏  举报