[Qt-interest] Problem in drawing JPEG image from raw data

trinathpujari trinathpujari at tataelxsi.co.in
Fri Nov 27 10:42:15 CET 2009


Hi All,

          I am facing problem in drawing a jpeg image. I am drawing the 
image from a raw buffer by using the below code
                   QByteArray readCompressed = 
QByteArray::fromRawData((char *)ImageBuffer,5000);
          QImage *readImg = new QImage();

          readImg->loadFromData(readCompressed);

         QPainter painter(readImg );

          painter->drawImage(0,0,*readImg);


         But the function call fromRawData() is failing. It is working 
perfectly fine for PNG.
         Can anybody knows the above problem, please help me in 
resolving this problem.


Thanks in Advance....


Regards
Trinath






More information about the Qt-interest-old mailing list