Galera queria abrir um jpg escrever um texto nele e fechar novamente.
Eu fiz assim:
public static void pintaImg(){
BufferedImage img = null;
try {
img = ImageIO.read(new File("zica.jpg"));
} catch (IOException ex) {
ex.printStackTrace();
}
int w = img.getWidth(null);
int h = img.getHeight(null);
BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
Graphics g = bi.getGraphics();
g.drawImage(img, 0, 0, null);
g.setFont(new Font("Arial", Font.BOLD, 26));
g.drawString("Zica", 70, 30);
try {
ImageIO.write(img, "PNG", new File("zica.jpg"));
} catch (IOException ex) {
ex.printStackTrace();
}
}
Ele mostra a imagem escrita, mas quando mando salvar o escrito não vai, o que esta faltando?
Valeu