私のeclipse-rcpアプリケーションでは、30000x10000 px以上のサイズの画像を作成する必要があります。この画像はNatTableの表現です。 OutOfMemory、SWTError - IllegalArgumentまたはPCが応答を停止する(btw、ウィンドウ7、64ビット、4 RAMクライアントのラップトップは非常に遅いが、まだ画像を作成する必要がある) 。コードスニペットは次のとおりです。大きなSWTイメージを作成する方法は?
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 Advanced Imaging Apiはこの目的に適していますか?
ご迷惑をおかけして申し訳ございません。
テーブルを画像ファイルに保存したいですか? – Sorceror
この記事は、私がいくつかの画像問題 - [SWT image resources](http://www.eclipse.org/articles/Article-SWT-images/graphics-resources.html)を見ているときに私を助けました – Sorceror
ありがとう記事、私は間違いなくそれを見てみましょう。いいえ、テーブルにファイルを保存する必要はありません。実際には、PaperClips ImagePrintを使用してNatTableを印刷するには、ImageDataオブジェクトを取得する必要があります。基本的に、私はテーブルを印刷する必要があります。 –