المدرجة أدناه أيضا :
يحاول {
String targetImg = "D:/Blue Hills.jpg";
// String pressImg = "D:/20130311220300.jpg";
String pressImg = "D:/html_original.jpg";
File f1 = new File(targetImg);
قراءة الصورة src = ImageIO ( f1 ) ;
int width = src.getWidth(null);
int height = src getHeight ( null ) ;
BufferedImage image = new BufferedImage ( العرض , الارتفاع , BufferedImage . TYPE_INT_RGB ) ;
الرسومات g = image.createGraphics();
g.drawImage(src, 0, 0, width, height, null);
الملف f2 = ملف جديد (pressImg)؛
الصورة src_pao = ImageIO.read(f2);
int width_pao = src_pao.getWidth(null);
int height_pao = src_pao.getHeight(null);
g.drawImage(src_pao, (width-+pao_width)/2, (height-pao_height)/2,pao_width,pao height, null);
// g drawImage ( src_pao , 100 , 100 , العرض , الارتفاع , null);
g.dispose();
FileOutputStream out = new FileOutputStream(targetImg);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
encoder.encode(image);
out.Close();
System.out.println("إخراج لوحة الترخيص !!");
} قبض (الاستثناء ه) {
// TODO: التعامل مع الاستثناء
System.out.println("نوبات الترفيه !!");
printStackTrace();
} }