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;
}
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");
}