我运行一个无GUI的程序:截取当前的屏幕。在开发板(arm-linux)上屏幕中间为什么会出现一个小的正方形,之前我以为是鼠标的原因,后来去掉的鼠标,但是还是在所有截取的图片上都有这个绿色正方形。不知道有没有解决方案?
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWSServer::setCursorVisible(false);
QPixmap originalPixmap = QPixmap(); // clear image for low memory situations
// on embedded devices.
originalPixmap = QPixmap::grabWindow(QApplication::desktop()->winId());
QString format = "png";
QString initialPath = QDir::currentPath() + QObject::tr("/") + tempDir + QObject::tr(".") + format;
originalPixmap.save(initialPath, format.toAscii());
return app.exec();
}