先用java导入数据,生成二进制图形数据,然后用imageio生成jpg格式:
importjava.io.*;
importjavax.imageio.*;
importjava.awt.image.*;
publicclassFileOperations{
publicstaticBufferedImagereadImageFromFile(Filefile)
throwsIOException
{
returnImageIO.read(file);
}
publicstaticvoidwriteImageToJPG
(Filefile,BufferedImagebufferedImage)
throwsIOException
{
ImageIO.write(bufferedImage,"jpg",file);
}
}