How to Qt Screen Capture using GrabWindow
-
Hi,
I am new to qt and programming world and please help me with this problem. I am runnign Qt on VxWorks and trying to capture Qt Window screen using grabWindow.
below is the function that I used. When I run, it prints the debug msg but does not generate any files.
Please correct me if I made any mistake.Also how to I change the path where the file is saved?
@void ScanControlInterface::TopDisplay_Capture( )
{
QPixmap capture = QPixmap::grabWindow(QApplication::desktop()->winId(),0,0,QApplication::desktop()->width(),QApplication::desktop()->height());
QByteArray ptrImgRawData;
ptrImgRawData.clear();
QBuffer buffer(&ptrImgRawData);
buffer.open(QIODevice::WriteOnly);
capture.save(&buffer,"PNG");qDebug ("ScanControlInterface::Screen captured");
}@