Taking Screenshots from code

Please use a mailing-list, see http://gephi.org/developers/
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Warlax
Posts:18
Joined:19 May 2010 20:45
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Taking Screenshots from code

Post by Warlax » 29 Jul 2010 19:38

Hi,

I would like to take a screenshot of the workspace from within the code.
The idea is to programmatically change the graph (remove a node) and take a screenshot, then repeat the process until some condition occurs (network fragmentation).

I know how to remove a node, not a problem.
Is there an accessible API to take a screenshot and save it to file?

Thank you,
Warlax.

User avatar
mbastian
Gephi Architect
Posts:728
Joined:10 Dec 2009 10:11
Location:San Francisco, CA
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Taking Screenshots from code

Post by mbastian » 03 Aug 2010 21:22

Hi, there is no API for doing that yet, I suggest to add this to the Ideas list.

A workaround is to use the PDF output. From the PDF you can easily get a PNG screenshot by any resolution using PDF Renderer library.

Warlax
Posts:18
Joined:19 May 2010 20:45
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Taking Screenshots from code

Post by Warlax » 09 Aug 2010 17:35

Hi,

I can use the Robot class (http://download-llnw.oracle.com/javase/ ... Robot.html)
to take automatic screenshots - but I'd like to only take a screenshot of the workspace area. This is probably some NetBeans platform code - is there a way to get the x,y and width,height of that window area?

Thanks,
Warlax.

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable