我想将BufferedImage
转换为java.awt.Image
。
我的源图像是tif格式,所以我使用JAI将其读取为PlanarImage
:
PlanarImage source = JAI.create("fileload", IMG_DIR + tagImgName);
然后将其保存为对象属性作为BufferedImage
tagImg = source.getAsBufferedImage();
对于.pdf导出(通过iText),我需要将其作为java.awt.Image
。
谢谢!