[Qt-interest] how to read bitmap emdedded in XML
Jason H
scorp1us at yahoo.com
Tue Aug 17 19:45:22 CEST 2010
Well, by the filename, you know it is a .png...
----- Original Message ----
From: Eckhard Jokisch <e.jokisch at orange-moon.de>
To: qt-interest at trolltech.com
Sent: Tue, August 17, 2010 1:39:05 PM
Subject: Re: [Qt-interest] how to read bitmap emdedded in XML
Am Dienstag 17 August 2010, 18:05:58 schrieb Andre Somers:
> 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">
> >
> > iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAIAAAC6s0uzAAAACXBIWXMAAA7DAAAOwwHHb6hkA
> > AAg
> > AElEQVR4nOy913McV7buuf6KPu+nYx66JVK08N4UTAEgvCsUPEkZkqJEgkb03sAQ9Fb03gok
> > 6A1o
> > ZFoS5/aZMzEd8zSac5/moSPuvX9Bz8NOJLKysqqyTK5voTIRX4QoICu/3/62WTuzHNGyj47p
> > f3fy ......
> >
> > </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é
>
Thanks for the answer.
Unfortunately after:
image->fromData(bA.toHex());
int format = image->format();
the format is 0.
How could I fix this?
Eckhard
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list