方法一:
// Define the source and destination file names.
String inputFile = /images/Rose.tif
String outputFile = /images/Rose.jpg
// Load the input image.
RenderedOp src = JAI.create("fileload", inputFile);
// Encode the file as a JPEG image.
FileOutputStream stream =
new FileOutputStream(outputFile);
JAI.create("encode", src, stream, JPEG, null);
// Store the image in the BMP format.
JAI.create("filestore", src, outputFile, JPEG, null);
(请阅读:)
阅读(4232) | 评论(0) | 转发(0) |