Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Take screenshot of RCP application window(Take screenshot of RCP application window)
Take screenshot of RCP application window [message #1102892] Fri, 06 September 2013 03:01
bava 502 is currently offline bava 502
Messages: 6
Registered: August 2013
Junior Member
Hi,

I am developing one application based on RCP and after a button click from the app i need to take a screen shot of the application window. I have done below for this:

GC gc = new GC(getShell().getDisplay());

final Image image = new Image(getShell().getDisplay(),getShell().getBounds());
gc.copyArea(image, getShell().getBounds().x,getShell().getBounds().y);
gc.dispose();

ImageLoader loader = new ImageLoader();
loader.data = new ImageData[]{image.getImageData()};
File imageFile = new File(fileName);
loader.save(fileName,SWT.IMAGE_PNG);

image.dispose();


I am able to take screen shot and save it with the above code but its behavior is same as windows "Print screen". Whatever is displaying on the screen it is capturing that image. For example, If i click capture button from my RCP window and immediately minimize it then my desktop image is captured but not the RCP app window.How to capture RCP window even if it is minimized(no focus). Please help
Previous Topic:[EMF DataBinding] - Getter called outside realm of observable
Next Topic:Replace (or extend) CTRL+F functionality in CNF
Goto Forum:
  


Current Time: Fri Aug 22 15:55:12 EDT 2014

Powered by FUDForum. Page generated in 0.01495 seconds