int canvasHeight, int startRes)
{
SequenceGroup group = av.getSelectionGroup();
- BufferedImage selectImage = new BufferedImage(canvasWidth, canvasHeight,
- BufferedImage.TYPE_INT_ARGB); // ARGB so alpha compositing works
+ BufferedImage selectImage = null;
+
+ try
+ {
+ selectImage = new BufferedImage(canvasWidth, canvasHeight,
+ BufferedImage.TYPE_INT_ARGB); // ARGB so alpha compositing works
+ } catch (OutOfMemoryError er)
+ {
+ System.gc();
+ System.err.println("Print image OutOfMemory Error.\n" + er);
+ new OOMWarning("Creating wrapped alignment image for printing", er);
+
+ return;
+ }
if (group != null)
{