PDA

View Full Version : jpeg image not getting displayed



nitks.abhinav
17th October 2017, 21:06
Hi,

I am having issues in displaying jpeg image, My code first displays the gif image using QMovie.

The finished signal of movie is connected to slot which should show a jpeg image.

Below is the sample code, Base is the main GUI thread.

Note: If I use fbi tool to display image it works fine.


void Base::displayWelcomeScreen()
{
//Start the presentation (gif)
presnLabel.resize(480,350); //keeping width 350 acc to the gif
movie.setFileName("/usr/.images/is5RaptorLoading.gif");
presnLabel.setMovie (&movie);
movie.start ();
presnLabel.show();
}
/*Slot function*/
void Base::displaySysInfoScreen()
{
//Display the Raptor system information screen
presnLabel.hide();
qDebug() << "Main Thread (BASE): Displaying the system information screen \n";
QPixmap pm("usr/.images/is5RaptorSysInfo.jpeg");
presnLabel.setPixmap(pm);
presnLabel.show();
}

Lesiok
18th October 2017, 08:21
Check if you have a jpeg plugin.

nitks.abhinav
18th October 2017, 16:30
Yes you are correct, the jpeg plugin was not there, Thank you.

I have couple of more questions related to this:

1) Can bmp image be displayed in similar way?
2) My jpeg is not aligned to the LCD screen, I can see it shifted to both right and up. Hoe to align it?

Thanks

nitks.abhinav
18th October 2017, 21:29
I have found the way, Thanks for all the help!