/** * Exports the drawing as a BMP picture. * @param file The targeted location. * @return true if the picture was successfully created. */ protected boolean exportAsBMP(final File file){ final RenderedImage rendImage = createRenderedImage(); try { final ImageWriteParam iwparam = new BMPImageWriteParam(); final ImageWriter iw = ImageIO.getImageWritersByFormatName("bmp").next();//$NON-NLS-1$ try(final ImageOutputStream ios = ImageIO.createImageOutputStream(file);) { iwparam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); iw.setOutput(ios); iw.write(null, new IIOImage(rendImage, null, null), iwparam); iw.dispose(); return true; } } catch(final IOException e) { BadaboomCollector.INSTANCE.add(e); } return false; }