I am using a QPixmap to take a screenshot of my desktop. I would like to convert this QPixMap to QByteArray.
How ?
I am using a QPixmap to take a screenshot of my desktop. I would like to convert this QPixMap to QByteArray.
How ?
Have you tried it using QPixmap::save. From the Qt Docs:
Qt Code:
QPixmap pixmap; QByteArray bytes; pixmap.save(&buffer, "PNG");To copy to clipboard, switch view to plain text mode
Thanks for the answer.
Now I have everything in a QByteArray. Now, I am parsing my QByteArray which has XML format. The parsing is done with DOM.
I need an element of the XML (QByteArray) to be comverted or used as QByteArray.
How ?
I do not want to transform the element to string, because I think I will loose the picture.
Qt Code:
{ doc.setContent(incomingMessage); n = n.nextSibling(); chatGui->screenshot(screenshot); }To copy to clipboard, switch view to plain text mode
Last edited by probine; 2nd May 2006 at 15:30. Reason: add code
I guess you must do something like that
Qt Code:
QByteArray screenshot; screenshot.setRawData(e.text().data(),e.text().lenght());To copy to clipboard, switch view to plain text mode
a life without programming is like an empty bottle
How to convert QPixmap to QByteArray ? I encountered the problem now.
You have the answer in second post.
Bookmarks