package com.yunfengtech.solution.business;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import javax.imageio.ImageIO;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;public class Twopic{
public static void main(String[] args){
File file = new File(".\\src\\image");
System.out.println(file.getAbsolutePath());
try
{
System.out.println(file.getCanonicalPath());
} catch (Exception e)
{
e.printStackTrace();
}
}
public static void main(String[] args){
try {
InputStream imagein1 = new FileInputStream("D:/twopic/n01.bmp");
InputStream imagein2 = new FileInputStream("D:/twopic/n02.bmp");
InputStream imagein3 = new FileInputStream("D:/twopic/n03.bmp");
BufferedImage bg_image = new BufferedImage(, , BufferedImage.TYPE_INT_BGR);
BufferedImage image1 = ImageIO.read(imagein1);
BufferedImage image2 = ImageIO.read(imagein2);
BufferedImage image3 = ImageIO.read(imagein3);
Graphics g = bg_image.getGraphics();
g.drawImage(image1, , , , ,null);
g.drawImage(image2, , , , ,null);
g.drawImage(image3, , , , ,null);
OutputStream outImage = new FileOutputStream("D:/twopic/playitemid_1_2.bmp");
JPEGImageEncoder enc = JPEGCodec.createJPEGEncoder(outImage);
enc.encode(bg_image);
imagein1.close();
imagein2.close();
imagein3.close();
outImage.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}