Display BMP image from raw bitmap file
I am using Ti AM335x Board.
I am trying to create a QT application which will display a image (bmp) from a raw bitmap file. The raw bitmap file is of .panel file format. Its in RGB565 format.
How do we use/convert the raw bitmap (img.panel) into a bmp file, so I can use it Qimage.
Here is my sample Code :
QByteArray array = file.readAll();
QImage image((const uchar*)array.data(), h_bitmap, v_bitmap, QImage::Format_RGB16);
image = image.convertToFormat(QImage::Format_RGB16);
Here I am able to get the bmp image on label. But the image is distorted a lot. Its not as original image.
Could any one help on this regard.
Hi and welcome to devnet,
What happens if you just open the file in a QImage before setting it on the QLabel ?
The image itself is distorted before sending it to Qlabel.
Here is the image I get after i run the above code. The display is 160 X 128 LCD. No touch screen and No mouse.
Original image should be like this.
Any help is appreciated.
Is your LCD working in RGB888 ?
The LCD works on RGB565 (16bit). Its dimension is 160x128.
This is the .panel file i.e. is the raw file.
I am trying to read this file and doing above operation.
This is the original image file
s000.tinyupload.com/?file_id=37294795439804064119 Thanks for helping.
How do I get a .panel file ?
I download a jpeg file width 160x128.
Then use a package called "netpbm" to convert it to .ppm format.
Use the package "ppmtopanel" (which is a proprietary package) to convet the .ppm file to .panel file. Now this .panel file is raw file. Its not a bitmap file. But it contains some image.
Thank you for helping.
Do you have Qt configured to use that display ?