|
@@ -107,7 +107,28 @@ if __name__ == "__main__":
|
107
|
107
|
imageDir = os.path.join(scriptDir, "images")
|
108
|
108
|
for f in os.listdir(os.fsencode(imageDir)):
|
109
|
109
|
filename = os.fsdecode(f)
|
110
|
|
- m.add(ImageScreen(t, filename))
|
|
110
|
+
|
|
111
|
+ d = ImageScreen(t, filename)
|
|
112
|
+ m.add(d)
|
|
113
|
+
|
|
114
|
+ if filename != "Favicon.png":
|
|
115
|
+ continue
|
|
116
|
+
|
|
117
|
+ # dump generated image to console, for embedding in Pico script
|
|
118
|
+ print()
|
|
119
|
+ print("Dumping image to img_tmp.py")
|
|
120
|
+ with open("img_tmp.py", "w") as f:
|
|
121
|
+ f.write("# Image \"" + filename + "\"" + os.linesep)
|
|
122
|
+ f.write("# size:" + str(d.image.width) + "x" + str(d.image.height) + os.linesep)
|
|
123
|
+ f.write("img_data = [" + os.linesep)
|
|
124
|
+ for y in range(0, d.image.height):
|
|
125
|
+ f.write(" [" + os.linesep)
|
|
126
|
+ for x in range(0, d.image.width):
|
|
127
|
+ s = str(d.image.getpixel((x, y)))
|
|
128
|
+ f.write(" " + s + "," + os.linesep)
|
|
129
|
+ f.write(" ]," + os.linesep)
|
|
130
|
+ f.write("]" + os.linesep)
|
|
131
|
+ print()
|
111
|
132
|
|
112
|
133
|
m.restart()
|
113
|
134
|
t.loop(m.draw)
|