I have a Raspberry Pi 3B device connected to a LCD '7 (7 inches LCD, its a touch screen I believe that's called DSI not sure) and also a HDMI screen.

By default Raspbian considers the LCD as the default screen and send the framebuffer to that device.

I understand that can be changed from /boot/config.txt file, however this will disable the LCD '7.

My goal is to be able to show a picture on the HDMI device while LCD is active. Please note:

  1. The sound from the HDMI is irrelevant

  2. I understand that there is only one framebuffer and need a way around that.

  3. I rather use C++ code if programming is necessary (but I am open to learn any other programming languages)

  4. The task is to show an image file (e.g .png, .jpg) not a binary buffer (because I have no idea how to generate a binary buffer in the first place but I'm open to suggestions)

  5. I already tried fbi, doesn't satisfy my needs.

  6. I tried dispmanx.c program located: /opt/vc/src/hello-pi/hello-displmanx/, it does exactly as I expect with the difference that I can't find a way to make that code to show an actual .png file on the screen.

I understand that a similar question has been already asked, but it seems that I have trouble understanding the solution suggested for it as I find the answer complicated for my level of knowledge.

I am new to C language and libraries. any suggestions on manipulation of dispmanx.c file to handle the task in hand are welcome.

I am also open to any other suggestions.

edit: I found http://www.raspberry-projects.com/pi/programming-in-c/display/dispmanx-api/dispmanx-api-general which has a pngviewer.c file which seems able to handle my problem, but after making the program and calling ./pngviewer I receive the following error:

./pngview: error while loading shared libraries: libraspidmx.so.1: cannot open shared object file: No such file or directory

command I used: ./pngview myPic.png

  • 1
    you asked this question an hour before this one.... please add any new information to that question and delete this one – jsotola Aug 8 '18 at 13:45
  • yes, for some reason I was not allowed to comment on that question, and also the question didn't appear in my question list in my profile. so actually I have no access to that one for some reason. I understand this might have happen cause I have 2 accounts and the previous question could have been signed to my other account, it was not the case. it would be nice if I could delete the other question and keep this one, but I can't find the option to delete that one as the system doesn't recognize me as the owner of that question. any suggestion how to delete that one would be endearing thank you – Ben Aug 9 '18 at 6:44
  • you do not add information into comments .... you add information to the question .... click the edit button and update the question – jsotola Aug 9 '18 at 14:44
  • This user still has two accounts, that need to be merged: raspberrypi.stackexchange.com/users/90464/ben and raspberrypi.stackexchange.com/users/90465/ben – Greenonline Aug 20 '18 at 20:28
  • @Greenonline, please note that accounts are merged per user request only: If you have two accounts that you would like to join together. It is supposed to be a convenience for the user and needs to be triggered by the user. Having multiple accounts is in fact ok as long as they aren't voting for each other among a few other things (aka sockpuppet), see here. – Ghanima Aug 20 '18 at 20:43

I found a well structured program in git hub :


which handles my task. to open a .png file and show it on the HDMI display while DSI screen is functioning as the main screen on the raspberry pi.

after download and running the 'make' in the subfolder of the program, an executable file will be generated in pngview folder, I used that executable and I gave '-d 5' as the input parameter of the object which describes the HDMI port as output of the view.

the whole command: ./pngview -d 5 myPng.png

Note: if upon execution you faced an Error:

while loading library: libraspidmx.so.1

read this discution: https://github.com/AndrewFromMelbourne/raspidmx/issues/16

in brief this will fix the execution error:

sudo cp lib/libraspidmx.so.1 /usr/lib/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.