import java.io.OutputStream;
import javax.media.jai.RenderedOp;
import com.sun.media.jai.codec.ImageCodec;
import com.sun.media.jai.codec.ImageEncoder;
* Created on 2004-8-22
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
* @author Huang Jinxiang
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class Test {
public static void main(String[] args) throws Exception{
String inputFile = "me.tif";
String outputFile = "out.bmp";
RenderedOp src = JAI.create("fileload", inputFile);
BMPEncodeParam param = new BMPEncodeParam();
ImageEncoder enc = ImageCodec.createImageEncoder("BMP", os,
param);
enc.encode(src);
os.close();
}
}
只不过用不同的codec..