BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
Graphics g = image.getGraphics();
g.drawString("Hello World!!!", 10, 20);
try {
ImageIO.write(image, "jpg", new File("c:/CustomImage.jpg"));
} catch (IOException e) {
e.printStackTrace();
}
-
Excellent - thank-you. It was exactly what I was looking for.
ReplyDeleteGreat program with little extra customizations,
ReplyDeleteImages can be created in java without any extra libs,
http://www.javadomain.in/creating-image-using-java-without-extra-libs/