summaryrefslogtreecommitdiff
path: root/tizen
diff options
context:
space:
mode:
authorRahul Dadhich <r.dadhich@samsung.com>2020-07-03 14:32:26 +0530
committerKarthik Bhat <kv.bhat@samsung.com>2020-07-06 05:03:20 +0000
commit6c9bf40f3f2447a07c05c7c91eb53a034bde24b4 (patch)
treedb7e49d0f252f7fa7b3dc66bb173a7513ecdd31d /tizen
parentd83135eac4de9ea7ab0464afa4b1e96a3b93e241 (diff)
downloadqemu-6c9bf40f3f2447a07c05c7c91eb53a034bde24b4.tar.gz
qemu-6c9bf40f3f2447a07c05c7c91eb53a034bde24b4.tar.bz2
qemu-6c9bf40f3f2447a07c05c7c91eb53a034bde24b4.zip
[SPTSDKUX-5571] changing screenshot save logic
Change-Id: I9dc024ecccf6f4087f49d9d478dbfbb30fd16c94 Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
Diffstat (limited to 'tizen')
-rw-r--r--tizen/src/ui/menu/screenshotdialog.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/tizen/src/ui/menu/screenshotdialog.cpp b/tizen/src/ui/menu/screenshotdialog.cpp
index c57a7bb077..be5e7b7e3e 100644
--- a/tizen/src/ui/menu/screenshotdialog.cpp
+++ b/tizen/src/ui/menu/screenshotdialog.cpp
@@ -177,9 +177,12 @@ bool ScreenShotDialog::slotSave()
return false;
}
- QPixmap pixmap(shotData);
+ QImage image(scene->sceneRect().size().toSize(), QImage::Format_ARGB32); // Create the image with the exact size of the shrunk scene
+ image.fill(Qt::transparent); // Start all pixels transparent
+ QPainter painter(&image);
+ scene->render(&painter);
qDebug() << filename;
- pixmap.save(filename);
+ image.save(filename);
return true;
}
@@ -190,8 +193,12 @@ void ScreenShotDialog::slotCopy()
QClipboard *clipboard = QApplication::clipboard();
if (clipboard != NULL) {
+ QImage image(scene->sceneRect().size().toSize(), QImage::Format_ARGB32); // Create the image with the exact size of the shrunk scene
+ image.fill(Qt::transparent); // Start all pixels transparent
+ QPainter painter(&image);
+ scene->render(&painter);
clipboard->clear();
- clipboard->setPixmap(shotData);
+ clipboard->setImage(image);
} else {
qWarning("cannot copy to clipboard");
}