Advertisement

optimizing pixmap reading

Started by February 01, 2005 08:06 PM
-1 comments, last by tadobie 19 years, 10 months ago
HI, I am writing an app which does pixel by pixel comparison. I chose to use Qt because it seems to have plenty of really usable functionality and more importantly documentation that I can understand. The is one line of code which on diagnosis is the casue of my problems (the rest of my code runs at an acceptable rate). I am taking a screen grap(this occurs quickly enough), then using "pixmap.save()" to load a "BMP formated Image into a buffer. ie; QPixmap pmap; QByteArray array; QBuffer buf( array ); if ( !pmap.save( &buf, "BMP" ) ) cout << "error newImage to buffer" << endl; Since this process involves convert to a QImage and then writing to the buffer it is creating a bottle neck. It takes around 300ms. Is there a faster way to acheive the same result? eg. read straight to the memory buffer from the pixmap without the conversion step.
Don't mug ya self!

This topic is closed to new replies.

Advertisement