From 0372d4462968b87c02d53ddf61324857f058b575 Mon Sep 17 00:00:00 2001 From: Munkyu Im Date: Mon, 27 Oct 2014 18:28:30 +0900 Subject: [PATCH] screenshot: Show blank image Just in case when fail to get rendered image from frame buffer. Change-Id: Ia460941a51046da16a3f3927d27f4746ca5c1bd8 Signed-off-by: Munkyu Im --- tizen/src/ui/mainwindow.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tizen/src/ui/mainwindow.cpp b/tizen/src/ui/mainwindow.cpp index da749c77f6..abbdba2f9e 100644 --- a/tizen/src/ui/mainwindow.cpp +++ b/tizen/src/ui/mainwindow.cpp @@ -351,20 +351,23 @@ void MainWindow::unsetCaptureRequestHandler(void *data) void MainWindow::processCaptured(bool captured, void *pixels, int width, int height) { - qDebug("window process captured: %d %p[%dx%d]", + qDebug("window process captured: %d pixel: %p [%dx%d]", captured, pixels, width, height); if (captured) { - QImage image = QImage((uchar *)pixels, width, height, - QImage::Format_RGB32); + QImage image = QImage((uchar *)pixels, width, height, QImage::Format_RGB32); QPixmap pixmap = QPixmap::fromImage(image); /* deep copy the data */ QMetaObject::invokeMethod(popupMenu, "slotShowScreenshot", - Qt::QueuedConnection, - Q_ARG(QPixmap, pixmap)); - + Qt::QueuedConnection, + Q_ARG(QPixmap, pixmap)); qDebug("Image saved: %p", pixels); + } else { + QPixmap pixmap(uiInfo->resolution.width(), uiInfo->resolution.height()); + QMetaObject::invokeMethod(popupMenu, "slotShowScreenshot", Qt::QueuedConnection, Q_ARG(QPixmap, pixmap)); + qDebug("Blank Image saved"); } + } void MainWindow::setTopMost(bool on) -- 2.34.1