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?

有帮助吗?

解决方案 3

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

其他提示

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?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top