
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;


public class main
{
	Image lune, terre;	
	
   public static void main(String [] args)
   {    
	
	
	   BufferedImage img = null;
	   try {
	       img = ImageIO.read(new File("d:/raspberry.jpg"));
	   } catch (IOException e) {
	   }
	   
	   Graphics gO = img.createGraphics();
	   gO.setColor(Color.RED);
	   Font font = new Font("Arial", Font.PLAIN, 48);
	   gO.setFont(font);
	   
	   gO.drawString("Salut", 200, 175 );
	  // Graphics g = getGraphics();
	   //g.drawString ("Hello World", 10, 10);
	   
	   
	   try {
		    // retrieve image
		    File outputfile = new File("d:/saved.jpg");
		    ImageIO.write(img, "jpg", outputfile);
		} catch (IOException e) {
		    
		}
	/*try 
	{
		lune = ImageIO.read(new File("lune.gif"));
		terre = ImageIO.read(new File("world.gif"));
	}
	catch(IOException exc) {
		exc.printStackTrace();
	}*/

}
   
}
