Created
January 9, 2019 11:37
-
-
Save ordovician/d93f7580f6884b2fb972226d0cf68c52 to your computer and use it in GitHub Desktop.
[Dump QPixmap to File] This is to help debug code where pixmaps are created #qt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QtCore/QFile> | |
#include <QtCore/QDir> | |
/// Store pixmap in home directory as .png file | |
static void | |
DumpPixmapToFile(const QPixmap &pixmap) { | |
QString filepath = QDir::home().filePath("debug-pattern.png"); | |
pixmap.save(filepath, "PNG"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment