I have a pySimpleGUI program that create an image from a memory buffer containing a JPEG image.
from PIL import ImageTk
image = ImageTk.PhotoImage( data=buf) # PhotoImage will detect a JPEG format
self.win["-IMAGE-'].update( data=image)
I want to convert my application to pySDL2.
Since pySimpleGUI and pySDL are both based on PIL, I was expecting an easy conversion but I can't find a way to create a SDL image from a buffer.
Is there a way?
Not sure this works and is untested but might bring you down the right track. If you want more of the nitty-gritty behind this visit https://rubato.app/. The full source code of the Image class is there.