RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Loading png overlay with command line

    Scheduled Pinned Locked Moved Help and Support
    overlaypngcommand line
    7 Posts 3 Posters 542 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      Nash
      last edited by

      Hello,

      I need to add a custom png in front of a port game launched with my own script with xinit. I need to to the same job as Retroach's overlays but I don't find the command or the program used.

      It should be easy to load a png into a system that does it everywhere, but I'm stuck.

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by

        I'm not aware of any general method of overlaying an image on-top of a runing program, but you can set the background using feh and have the port's window fit in the middle.

        N 1 Reply Last reply Reply Quote 0
        • N
          Nash @mitu
          last edited by

          @mitu Thanks but I really need to add png over to hide some undesired window elements. And it will be useful later for me to do some OSD on anothers projects.

          1 Reply Last reply Reply Quote 0
          • N
            Nash
            last edited by Nash

            So nobody can tell me how to load png overlay with something already present in Retropie ? I would like to avoid adding another third-party program unnecessarily. Even that is hard to find.

            It drives me crazy, there are PNG loads absolutely everywhere with OSD displaying png or animations everywhere like widgets. I looked in the Retroarch source code but I didn't find anything in what I can understand.

            I don't find anything on the web. How did devs have learned to display PNG ?

            S 1 Reply Last reply Reply Quote 0
            • S
              sleve_mcdichael @Nash
              last edited by sleve_mcdichael

              @Nash i found this Reddit post https://www.reddit.com/r/linux_programming/s/AUs0i0Hhis

              In in it they suggest using pngview (https://github.com/AndrewFromMelbourne/raspidmx/tree/master/pngview), or suggests that also you can write directly to /dev/fb0 (https://seenaburns.com/2018/04/04/writing-to-the-framebuffer/)

              N 1 Reply Last reply Reply Quote 0
              • N
                Nash @sleve_mcdichael
                last edited by Nash

                @sleve_mcdichael It looks like very hard consisting to draw every pixel in a framebuffer. It should be existing something at easier level like "function load" '/home/pi/img/png.png' at "coord x" and "coord y" usable in a script.

                For instance EmulationStation themes are looking for load border.png, or pop games videos in front of everthing. I doubt the dev must code "draw each pixel in framebuffer" everytime. They call certainly existing commands avaiable in the OS environement.

                I will try pngview.

                1 Reply Last reply Reply Quote 0
                • N
                  Nash
                  last edited by

                  Ok, pngview was already installed on my system and used by the PiBoy OSD. I found a png loading used in the installscript of the firmware and I can reproduce this when I want with a single line added in my scripts. It's exactly what I was looking for !

                  @sleve_mcdichael Thanks for your help

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                  Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.