如何用java程序输出一个字符串到一张图片的右下角 如何用java程序输出一个字符串到一张图片的右下角?求高手指导。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public static void main(String[] args) { try { File file = new File("yang.png"); BufferedImage image = ImageIO.read(file); Graphics2D g2 = image.createGraphics(); g2.setColor(Color.red); g2.drawString("a test string!", image.getWidth() - 120, image.getHeight() - 14); g2.dispose(); ImageIO.write(image, "png", file); } catch (IOException e) { e.printStackTrace(); } } 关于float和double后面小数点数的问题 有关运行项目的问题 java的classpath2问题? JSP 验证 请教JAVA书籍问题 [提问]JAVA中线程与线程之间是怎么通信的啊? 求教关于包的存储位置问题? 怎样设置环境变量 急~~~~~~~~~马上要做项目了。 关于页面跳转????? 谁有Java上机练习题???? 为什么不能运行啊 求助
public static void main(String[] args) {
try {
File file = new File("yang.png");
BufferedImage image = ImageIO.read(file);
Graphics2D g2 = image.createGraphics();
g2.setColor(Color.red);
g2.drawString("a test string!", image.getWidth() - 120, image.getHeight() - 14);
g2.dispose();
ImageIO.write(image, "png", file);
} catch (IOException e) {
e.printStackTrace();
}
}