[Qt-interest] How to draw a X11 Pixmap?

Dong Tiger idlecat511 at gmail.com
Wed Mar 11 15:01:43 CET 2009


Hi all,

In my program, I have to create an X11 Pixmap, pass it to a component which
draws on the pixmap, and then I draw the pixmap on a QPaintDevice.
I have no much experience on X11 programming. My not-working code looks
like:

Pixmap pixmap = XCreatePixmap(QX11Info::display(),
QX11Info::appRootWindow(), width, height, 24);
// theComponent->doSomthingWithPixmap(pixmap);
QPixmap qpixmap = QPixmap::fromX11Pixmap(pixmap,
QPixmap::ExplicitlyShared);   // X error here
qainter->drawPixmap(0, 0, qpixmap);

The program receives an X error at the line converting Pixmap to QPixmap.
The detailed error message is "BadMatch (invalid parameter attributes)".
Change depth from 24 to 32 has no effect.

Do you know what's wrong with my code? TIA.

--
Tiger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090311/6c1c47b6/attachment.html 


More information about the Qt-interest-old mailing list