QPixmap::grabWindow does not work on some machines!
Hello,
please help to solve, QPixmap::grabWindow does work on some XP machines and does not
work on the others,meaning i get empty bytes array
void screenshoot(QByteArray *p_bar)
{
QBuffer a_Buf;
QPixmap originalPixmap;
originalPixmap = QPixmap::grabWindow(QApplication::desktop()->winId());
originalPixmap.save(&a_Buf, "jpg");
*p_bar = a_Buf.buffer();
}
Qt4, MSVW 2008, WinXP, project compiled in release
thanks in advance,
dima
Re: QPixmap::grabWindow does not work on some machines!
open the a_Buf using
Code:
pixmap.save(&buffer, "PNG"); // writes pixmap into bytes in PNG format
Re: QPixmap::grabWindow does not work on some machines!
thank you navi
it is almost works.
If i use bmp format it works on that (specific) computer,
but if u use Jpeg
QBuffer a_Buf;
a_Buf.open(QIODevice::WriteOnly);
QPixmap lPixmap;
Pixmap = QPixmap::grabWindow(QApplication::desktop()->screen()->winId());
lPixmap.save(QApplication::applicationDirPath() + "\\screenshoot.jpeg", "jpeg");
there is no jpeg file produced as well as the gif
thanks in advance,
dima
Re: QPixmap::grabWindow does not work on some machines!
i have found the problem,
it was plugins not setup on target machine.
looks like jpeg implemented in Qt as plugin.