wxWindows off-screen?

I

Ivan Voras

Is it possible to draw a widget or a window in an off-screen buffer?
What I'm trying to do is capture rendered HTML to a bitmap (in other
words, something like html2bitmap) by using wxWindows' HTML widget. If
anyone has a different way of doing it, I'd be glad to hear it...
 
M

Michele Petrazzo

Ivan said:
Is it possible to draw a widget or a window in an off-screen buffer?

(Assuming that you are on linux.)

wxWigets (wxWindows is the old name) or better, since if you are on a
python ng, wxPython :), can't be used if you are on a not-X machine:

michele:~$ env | grep DIS
DISPLAY=:0.0
michele:~$ export DISPLAY=
michele:~$ env | grep DIS
DISPLAY=
michele:~$ python
Python 2.4.4 (#2, Oct 20 2006, 00:23:25)
[GCC 4.1.2 20061015 (prerelease) (Debian 4.1.1-16.1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.Unable to access the X Display, is $DISPLAY set properly?
michele:~$ echo $?
1
michele:~$
What I'm trying to do is capture rendered HTML to a bitmap (in other
words, something like html2bitmap) by using wxWindows' HTML widget.
If anyone has a different way of doing it, I'd be glad to hear it...

For me you have some solutions:
- open an X server (only X, you don't need gdm, kdm other), set the
right DISPLAY env variable and use wx. Ok, you need (a lot of) memory,
that in my tests are about 16 M for Xorg and 24 for python with wx,
a wxFrame, wxPanel and some controls.
Can be a good/the right solution for me.
- If I remember correctly, there are a project that "emulate" an X
server (so the same that the X solution, but with less memory), but I
don't know its name... Try to search on internet.
- Always with an X server, use a browser and with its api (pyxpcom for
mozilla based, or dcop and pykde for konqueror and so on...), using
the "print on a file" feature, so print a ps and convert it on an
image.

Good try :), and not forgot to tell us your results!

Hope this help,
Michele
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top