Edit: Solved.
Edit: Sorry, meant to post this in the Developers forum.
Hi,
Just for my own experimentation purposes, I'm trying to implement screenshot functionality into BORG whereby just the BORG window (and no other windows or the desktop) is captured as an image and saved to some location. Setting up a button to initiate the action is easy enough but, due to my lack of experience with Swing or AWT, I'm having trouble capturing an image.
After some Googling, I found this class which allows you to create an image of a UI component.
I was wondering if I could somehow use this in BORG.
The file contains a few methods, each differing only slightly in how they capture an image, but they all either take a JComponent or Rectange (or both) as parameters. Is there any way I can feed a particular BORG component into one of these methods to achieve what I'm trying to do?
I apologise if this question is too vague, but any advice to push me in the right direction would be greatly appreciated.
Thanks,
Robin
Edit: I found the getSelectedComponent() method which I'm using to retrieve the relevant AWT component. After compiling, I was able to save an image to my working directory using the linked code, but it hasn't since worked. Trying to debug now.
Edit 2: Screenshot function now works as expected.
Last edit: Anonymous 2012-11-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Edit: Solved.
Edit: Sorry, meant to post this in the Developers forum.
Hi,
Just for my own experimentation purposes, I'm trying to implement screenshot functionality into BORG whereby just the BORG window (and no other windows or the desktop) is captured as an image and saved to some location. Setting up a button to initiate the action is easy enough but, due to my lack of experience with Swing or AWT, I'm having trouble capturing an image.
After some Googling, I found this class which allows you to create an image of a UI component.
http://pastebin.com/eKJER28Y
I was wondering if I could somehow use this in BORG.
The file contains a few methods, each differing only slightly in how they capture an image, but they all either take a JComponent or Rectange (or both) as parameters. Is there any way I can feed a particular BORG component into one of these methods to achieve what I'm trying to do?
I apologise if this question is too vague, but any advice to push me in the right direction would be greatly appreciated.
Thanks,
Robin
Edit: I found the getSelectedComponent() method which I'm using to retrieve the relevant AWT component. After compiling, I was able to save an image to my working directory using the linked code, but it hasn't since worked. Trying to debug now.
Edit 2: Screenshot function now works as expected.
Last edit: Anonymous 2012-11-08