int width = bounds.width;
int height = bounds.height;
image = new Image(display, width, height);
gc.copyArea(image, 0, 0);
ImageLoader imageLoader = new ImageLoader();
imageLoader.data = new ImageData[] { image.getImageData() };
imageLoader.save(fileName, new ImageFormatConverter().imageTypeOf(fileName.substring(fileName.lastIndexOf('.') + 1)));
return true;
} catch (Exception e) {
log.warn("Could not capture screenshot: " + fileName + "'", e); //$NON-NLS-1$ //$NON-NLS-2$
File brokenImage = new File(fileName).getAbsoluteFile();
if (brokenImage.exists()) {