How to convert multi page Magick++ Image to QImage?
Posted: 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:
where:
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>
I welcome any suggestion.
Thanks!
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));
Code: Select all
QPixmap item1p;
QGraphicsScene *Scene;
QGraphicsPixmapItem *item1;
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" );
Thanks!