Hi,
I'm not able to save a pixmap data to jpeg format. but if I opt of png then it works. what am I missing here?
Note: I have my Qt built statically and thats when all this kind of wierd problems are showing up.
here is my code:
screenshotLabel->setPixmap(originalPixmap.scaled(screenshotLabel->size(),
Qt::KeepAspectRatio,
Qt::SmoothTransformation));
QString initialPath
= QDir::currentPath() + tr
("/imagecapture/untitled.") + format;
if (!fileName.isEmpty())
originalPixmap.save(fileName, format.toAscii());
originalPixmap = QPixmap::grabWindow(QApplication::desktop()->winId());
screenshotLabel->setPixmap(originalPixmap.scaled(screenshotLabel->size(),
Qt::KeepAspectRatio,
Qt::SmoothTransformation));
QString format = "jpeg";
QString initialPath = QDir::currentPath() + tr("/imagecapture/untitled.") + format;
QString fileName = initialPath;
if (!fileName.isEmpty())
originalPixmap.save(fileName, format.toAscii());
To copy to clipboard, switch view to plain text mode
thanks,
Bookmarks