You are not logged in.

1

Tuesday, December 14th 2010, 1:14pm

QT image displaying

I have following problem in QT.
I have a unsigned char * buffer which contains image data and i want to display it, how can i do that? I populated this buffer from jpg image.
I have written some code


QImage image;
QPicture pic;
pic.setData((const char*)buffer, fileLen);
image_display->setPicture(pic);


when i run this it gives me following error
QPicturePaintEngine::checkFormat: Incorrect header


Any help will be highly appreciated.
thnx in advance.
waiting for ur early reply....

2

Tuesday, December 14th 2010, 1:44pm

please anybody help me as i m new in qt programming.
actually i want to display picture from unsigned char *buffer which contains image data.

Junior

Professional

  • "Junior" is male

Posts: 1,613

Location: San Antonio, TX USA

Occupation: Senior Secure Systems Engineer

  • Send private message

3

Tuesday, December 14th 2010, 5:13pm

Take a look at using QPixmap loadFromDatafunction.