Hello,
I convert Magick++ single page Image to QT image (QPixmap, actually, but could be QImage as well) with:
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
));
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));
To copy to clipboard, switch view to plain text mode
where:
QPixmap item1p;
QGraphicsScene *Scene;
QGraphicsPixmapItem *item1;
To copy to clipboard, switch view to plain text mode
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>
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" );
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" );
To copy to clipboard, switch view to plain text mode
I welcome any suggestion.
Thanks!
Bookmarks