Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i convert binary codes to png image in qml?

In qml, i am using xml file to get some information from server. In this xml file there is a field as < image>iVBORw0KGgoAAAANSUhEUgAAA2AAAALKCAYAAABUYjK........< /image>. I am using XmlListModel and ListView for other field but how can i convert this code to png image.

like image 851
Gürcan Kavakçı Avatar asked Jul 19 '11 12:07

Gürcan Kavakçı


1 Answers

I didn't try myself, but if QML supports the data URI scheme (http://en.wikipedia.org/wiki/Data_URI_scheme), try

Image {
    source: "data:image/png;base64," + model.imageData
}
like image 197
blakharaz Avatar answered Nov 06 '22 01:11

blakharaz