Hi,

I am using Magick++ with QT and having a few problems. The most 
important of them is being it too slow. I display the images on 
QGraphicsView or QLabel and for this purpose I need to convert image to 
QPixmap and vice versa. This particular feature specially while writing 
image to Blob is too slow (Some times takes more than one and half 
second). Can someone point any useful information to solve this problem? 
Following is the snippet of code which I use to convert image to pixmap 
and vice versa:

void ITMagickGraphic::convertImageToPixmap()
{
   Blob imageBlob;
   image.magick("XPM");
   image.write(&imageBlob);
   const QByteArray imageData((char*)(imageBlob.data()), 
imageBlob.length());
   pixmapGraphic.loadFromData(imageData);
}

void ITMagickGraphic::convertPixmapToImage()
{
   QByteArray newImageData;
   QBuffer imageBuffer(&newImageData);
   imageBuffer.open(QIODevice::WriteOnly);
   pixmapGraphic.save(&imageBuffer,"JPEG");
   Blob newImageBlob(newImageData.data(),newImageData.size());
   Image 
newImage(newImageBlob,Geometry(pixmapGraphic.width(),pixmapGraphic.height()),"jpeg");
 

   image = newImage;
}


Thanks in advance,
Manoj
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to