Question

I'm looking for a way to essentially screen capture a whole wxPanel, and save it as a PNG. The kicker is, there is no screen. I need to be able to "draw" the panel and save the drawn panel with no actual screen. I'm using Python 2.7, running on Ubuntu 12.04.

Is this possible?

Was it helpful?

Solution 3

I found the trick, and lo, its name is VFB: http://linux.die.net/man/1/xvfb

OTHER TIPS

If there is no screen at all, i.e. no X11 display, then you wouldn't be able to even start a graphical wxWidgets program, so I'm not sure how exactly would you like this to work.

If you can start the program, then you can also use wxClientDC to capture the contents of any window: use its Blit() method to copy its contents to a wxMemoryDC into which you'd select the bitmap which will end up with the image of your window.

I wrote a tutorial on how to do this sort of thing here:

However, as someone already pointed out, if X (or similar) is unavailable, then you won't be able to generate a GUI of any sort. Or perhaps you meant a headless box (i.e. no monitor) rather than no screen?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top