You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, February 8th 2006, 9:15pm

slow QPixmap::convertToImage

Hello folks,

I've grabbed some shots of a QWidget but noticed that QPixmap::convertToImage is *VERY* slow (>500 msecs per shot!).

I used the following canonical (naive?) code:

QPixmap pix = QPixmap::grabWidget(myWidget);
QImage img = pix.convertToImage();
// get RGB frame

I mean I need an RGB frame of the given widget:
is there a way to access rgb values in QPixmap (also using non portable X11 code)?
or is there a faster method to convert a QPixmap to a QImage (and then use QImage::pixel() | bits())?

AFAIK the problem is that I need an RGB frame, but only the QImage class has methods such as pixel() bits().

I am testing under KDE3.1/Qt3.1 on FedoraCore3.

thank in advance!