How to convert multi page Magick++ Image to QImage?

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
eadorean
Posts: 7
Joined: 2013-02-08T13:46:47-07:00
Authentication code: 6789

How to convert multi page Magick++ Image to QImage?

Post by eadorean » 2013-09-08T08:46:48-07:00

Hello,

I convert Magick++ single page Image to QT image (QPixmap, actually, but could be QImage as well) with:

Code: Select all

Blob my_blob_1;
    Image img1;    
    img1.magick("MNG"); // or PNG
    img1.write(&my_blob_1);
    const QByteArray imageData1((char*)(my_blob_1.data()),my_blob_1.length());
    item1p.loadFromData(imageData1);
    item1 = Scene->addPixmap(QPixmap(item1p));
where:

Code: Select all

QPixmap item1p;
QGraphicsScene *Scene;
QGraphicsPixmapItem *item1;
My question is: how could I do that with multi page Image?
Below, I have a multipage image in a vector, I manipulate it with STL algorithms, but I can not find a way to output it to QT Image.
Magick++ writes it out to a single blob.
I would need to write to separate blobs for each page. Do I, or is there other way?
vector<Image> to QVector<QImage>

Code: Select all

Blob my_blob_111;
            vector<Image> imageListmpp;
            writeImages( imageListmpp.begin(), imageListmpp.end(), &my_blob_111 );
            Image aaa;
            aaa.read(my_blob_111);
            aaa.write( "D:/test/aaa.pdf" );
I welcome any suggestion.

Thanks!

Post Reply