1

I am using the following code to take screenshot in a Nokia device using Qt

QDesktopWidget *w = QApplication::desktop();
if (w)
{
        QRect r = w->screenGeometry();
        originalPixmap = QPixmap::grabWindow(w->winId(),0,0,r.width(), r.height());

}
originalPixmap.save(folder_path, format.toAscii().constData());

The code is working fine for portrait orientation. When I tilt the device to landscape, the captured image contains only half the width of the screen. Please help. Thanks in advance.

4

1 に答える 1

0

とにかくウィンドウ全体を取得したい場合は、使用してみましたoriginalPixmap = QPixmap::grabWindow(w->winId())か? サイズ パラメータを省略すると、ウィンドウ全体のサイズが自動的に使用されます。

于 2012-11-14T06:59:11.913 に答える