[Qt-interest] how to read bitmap emdedded in XML

Andre Somers andre at familiesomers.nl
Tue Aug 17 18:05:58 CEST 2010


  Op 17-8-2010 17:25, Eckhard Jokisch schreef:
> Hi,
> how can I get this part of an XML-file into a QPixmap?
> The bitmap data is embedded in the XML-File.
> The problem is, that the file "picture_1.png" does not exist yet and is the
> final target to store the QPixmap in.
>
> 	<tag name="ID_Object_1" type="CF_BITMAP" data="picture_1.png">
> iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAIAAAC6s0uzAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAg
> AElEQVR4nOy913McV7buuf6KPu+nYx66JVK08N4UTAEgvCsUPEkZkqJEgkb03sAQ9Fb03gok6A1o
> ZFoS5/aZMzEd8zSac5/moSPuvX9Bz8NOJLKysqqyTK5voTIRX4QoICu/3/62WTuzHNGyj47pf3fy
> ......
> 	</tag>
>
>
> Thanks for any hint
Looks like that data is base64 encoded. QByteArray has functions to deal 
with that, and a QImage can be created from data that's already in 
memory. You connect the dots :-)

André




More information about the Qt-interest-old mailing list