* @return <code>true</code> if the screenshot was created and saved, <code>false</code> otherwise.
* @since 2.0
*/
public static boolean captureScreenshot(final String fileName, final Control control) {
new ImageFormatConverter().imageTypeOf(fileName.substring(fileName.lastIndexOf('.') + 1));
return UIThreadRunnable.syncExec(new BoolResult() {
public Boolean run() {
if (control instanceof Shell)
return captureScreenshotInternal(fileName, control.getBounds());
Display display = control.getDisplay();
Rectangle bounds = control.getBounds();