MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / set_image_to_blank

Function set_image_to_blank

DemoPrograms/Demo_PNG_Thumbnail_Viewer.py:83–89  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

81
82
83def set_image_to_blank(key):
84 img = PIL.Image.new('RGB', (100, 100), (255, 255, 255))
85 img.thumbnail((1, 1), PIL.Image.LANCZOS)
86 bio = io.BytesIO()
87 img.save(bio, format='PNG')
88 imgbytes = bio.getvalue()
89 window[key].update(image_data=imgbytes)
90
91
92# get list of PNG files in folder

Callers 1

Calls 3

saveMethod · 0.80
newMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected