Results 1 to 3 of 3

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

  1. #1
    Join Date
    Feb 2013
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

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

    Hello,

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

    Qt Code:
    1. Blob my_blob_1;
    2. Image img1;
    3. img1.magick("MNG"); // or PNG
    4. img1.write(&my_blob_1);
    5. const QByteArray imageData1((char*)(my_blob_1.data()),my_blob_1.length());
    6. item1p.loadFromData(imageData1);
    7. item1 = Scene->addPixmap(QPixmap(item1p));
    To copy to clipboard, switch view to plain text mode 

    where:
    Qt Code:
    1. QPixmap item1p;
    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>

    Qt Code:
    1. Blob my_blob_111;
    2. vector<Image> imageListmpp;
    3. writeImages( imageListmpp.begin(), imageListmpp.end(), &my_blob_111 );
    4. Image aaa;
    5. aaa.read(my_blob_111);
    6. aaa.write( "D:/test/aaa.pdf" );
    To copy to clipboard, switch view to plain text mode 

    I welcome any suggestion.

    Thanks!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to convert multi page Magick++ Image to QImage?

    If you want only one of the images frames in the Magick Image in the Magick Blob then only give writeImage() a single iterator value. I don't see what this has to do with Qt.

  3. #3
    Join Date
    Feb 2013
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to convert multi page Magick++ Image to QImage?

    I want to convert vector<Image> to QVector<QImage>.
    This is the main scope.

    If the solution is to write the multipage image to separate blobs, than you are right. It has nothing to do with QT.
    But I do not know how to write every frame of a variable size (the size is known when the user opens the file) multipage image to multiple blobs. (each frame in separate blob).

    Thanks.

Similar Threads

  1. Loading image with Magick++, displaying with Qt
    By RSX in forum Qt Programming
    Replies: 5
    Last Post: 29th April 2013, 13:42
  2. Multi-page tiff image support for qimage
    By Johnny in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2013, 16:15
  3. Multi-page application and QStackedWidget
    By Mek82 in forum Qt Programming
    Replies: 10
    Last Post: 31st October 2010, 22:06
  4. multi page Application
    By ilpaso in forum Qt Programming
    Replies: 2
    Last Post: 3rd September 2010, 09:36
  5. Multi-Page PDF Output
    By igor in forum Qt Programming
    Replies: 1
    Last Post: 9th January 2007, 04:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.