raspidmx
raspidmx copied to clipboard
Read PNG Image constantly
Is it possible to a read PNG file continuously? For example every 2 seconds or check file size is different, but without pngview will be closed and restart, without a short black screen. As loop: killall -S9 pngview; ./pngview alien.png & Example so we can make png animation or read time and view it after convert in png.
Thanks, Patrick
isnt what https://github.com/AndrewFromMelbourne/raspidmx/tree/master/spriteview does?
@netzfreak It certainly would be possible to do, but it isn't something that I have time to do at the moment.
@fredericofs The spriteview program displays different parts of a single PNG image. It only reads the image once. These are known as sprite sheets.
I also have this problem. Is there a way to open a second image over the first one, and then close the first one?
No, unfortunately there is no way to do that currently @joachimvenaa.
Found a solution that works with me I'm now running this inside a while True loop:
os.system(PNGVIEWPATH + "/pngview -b 0 -l 300003 -x 650 -y 5 icons/battery25.png &")
i = 0
killid = 0
out = check_output("ps aux | grep pngview | awk '{ print $2 }'", shell=True)
nums = out.split('\n')
for num in nums:
i += 1
if i == 1:
os.system("sudo kill " + killid)
This first displays the new png, then kills the old one
So I definitely love opening up a 4 year old issue 👍
A very specific use case resulted in this being the perfect tool for me! But I too need an updating image layer.
I've got a while loop that can re-run code anytime the image file has been updated... but without any comments or instructions i'm struggling to figure out how to update that image layer so that it propagates
Are any of the imagelayer.c helper functions suitable for this? Or would I have to destroy and recreate the image layer each time?
@TheRealFlyingCoder : could you solve this somehow?