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

Atlant Schmidt aschmidt at dekaresearch.com
Tue Aug 17 19:49:58 CEST 2010


Eckhard:

  There's:

     QImage::loadFromData( const uchar * data,
                           int len,
                           const char * format = 0 )


  That looks like it's close to what you want, except
  that it delivers a QImage instead of a QPixmap. But
  then...

    http://doc.trolltech.com/3.3/qpixmap.html

    There are (slow) functions to convert between
    QImage and QPixmap: convertToImage() and
    convertFromImage().

  ...if you really need the pixmap and not the image.


  And if you don't like that, then there's always
  direct use of libpng. libpng wants to read from a
  file but can, with just a bit of work on your part,
  take an arbitrary bytestream and extract the PNG-
  formatted bitmap from it; see the section of the
  libpng.txt descriptive file that describes custom-
  izing libpng to use non-standard I/O routines.

  Others may, of course, have other ideas.

                           Atlant
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Eckhard Jokisch
Sent: Tuesday, August 17, 2010 11:25 AM
To: Qt-interest at trolltech.com
Subject: [Qt-interest] how to read bitmap emdedded in XML

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

Eckhard
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest

This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.




More information about the Qt-interest-old mailing list