我用的是Java高级成像。我已经有了瓷砖,并希望将所有的瓷砖放在一个PlanarImage中。下面的代码返回以下错误消息:
错误:一个工厂在线程"main“javax.media.jai.util.ImagingException中的操作”摩西“异常失败:所有工厂都失败了。
public static void loadTiles() {
RenderedImage[] source = new RenderedImage[new File("C:\\Users\\user\\workspace\\tiles\\67").listFiles().length-1];
System.out.println(source.length);
ImageLayout il = new ImageLayout(0, 0, 3306, 2336);
RenderingHints rh = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, il);
RenderedOp ro = MosaicDescriptor.create(source, MosaicDescriptor.MOSAIC_TYPE_OVERLAY, null, null, null, null, rh);
System.out.println(ro.getData()); // <<<< Throws Exception
PlanarImage pi = ro.createInstance();
File outputFile = new File("C:\\Users\\dgrimm\\workspace\\tiles\\output");
System.out.println(outputFile.getAbsolutePath());
JAI.create("filestore", pi, outputFile.getAbsolutePath(), "png");
}你能帮我改正错误吗?
发布于 2014-11-06 11:18:53
您只声明了存储瓷砖的数组。实际上,您还没有将这些块加载到数组中。
https://stackoverflow.com/questions/26775092
复制相似问题