在我的eclipse-rcp应用程序中,我需要创建一个尺寸为30000x10000像素或更大的图像。这个图像是NatTable的表示。使用标准的图像创建方法会出现不同的问题:OutOfMemory、SWTError - IllegalArgument或者我的PC停止响应(顺便说一句,它是Windows 7,64位,4 RAM - 客户端使用速度更慢的笔记本电脑,但是仍然需要创建图片)。下面是一个代码片段:
private Image getNattableImageRepresentation(final Display display) {
final Rectangle totalGridArea = getTotalGridArea(); //this returns Rectangle(0,0,30000,10000)
setGridLayerSize(totalGridArea);
final Image nattableImage = new Image(display, totalGridArea);
final GC nattableGC = new GC(nattableImage);
gridLayer.getLayerPainter().paintLayer(gridLayer, nattableGC, 0, 0, totalGridArea, configRegistry);//nattable API, which draws an image into a specified gc
restoreGridLayerState();
return nattableImage;
}
return null;
}
有没有什么技巧可以创建如此巨大的图像或者可能使用API?Java高级影像API是否适用于此目的?
欢迎提出任何建议。