Browse Source

pre-created images with less whitespace

Thomas Buck 1 year ago
parent
commit
fe8698be04
5 changed files with 1498 additions and 1498 deletions
  1. 3
    3
      image.py
  2. 816
    816
      img_tmp.py
  3. 3
    3
      qr.py
  4. 675
    675
      qr_tmp.py
  5. 1
    1
      test.py

+ 3
- 3
image.py View File

152
                 f.write("# size:" + str(d.image.width) + "x" + str(d.image.height) + os.linesep)
152
                 f.write("# size:" + str(d.image.width) + "x" + str(d.image.height) + os.linesep)
153
                 f.write("img_data = [" + os.linesep)
153
                 f.write("img_data = [" + os.linesep)
154
                 for y in range(0, d.image.height):
154
                 for y in range(0, d.image.height):
155
-                    f.write("    [" + os.linesep)
155
+                    f.write(" [" + os.linesep)
156
                     for x in range(0, d.image.width):
156
                     for x in range(0, d.image.width):
157
                         s = str(d.image.getpixel((x, y)))
157
                         s = str(d.image.getpixel((x, y)))
158
-                        f.write("        " + s + "," + os.linesep)
159
-                    f.write("    ]," + os.linesep)
158
+                        f.write("  " + s + "," + os.linesep)
159
+                    f.write(" ]," + os.linesep)
160
                 f.write("]" + os.linesep)
160
                 f.write("]" + os.linesep)
161
             print()
161
             print()
162
         except Exception as e:
162
         except Exception as e:

+ 816
- 816
img_tmp.py
File diff suppressed because it is too large
View File


+ 3
- 3
qr.py View File

125
             f.write("# size:" + str(d.image.width) + "x" + str(d.image.height) + os.linesep)
125
             f.write("# size:" + str(d.image.width) + "x" + str(d.image.height) + os.linesep)
126
             f.write("qr_data = [" + os.linesep)
126
             f.write("qr_data = [" + os.linesep)
127
             for y in range(0, d.image.height):
127
             for y in range(0, d.image.height):
128
-                f.write("    [" + os.linesep)
128
+                f.write(" [" + os.linesep)
129
                 for x in range(0, d.image.width):
129
                 for x in range(0, d.image.width):
130
                     s = str(d.image.getpixel((x, y)))
130
                     s = str(d.image.getpixel((x, y)))
131
-                    f.write("        " + s + "," + os.linesep)
132
-                f.write("    ]," + os.linesep)
131
+                    f.write("  " + s + "," + os.linesep)
132
+                f.write(" ]," + os.linesep)
133
             f.write("]" + os.linesep)
133
             f.write("]" + os.linesep)
134
     except Exception as e:
134
     except Exception as e:
135
         print()
135
         print()

+ 675
- 675
qr_tmp.py
File diff suppressed because it is too large
View File


+ 1
- 1
test.py View File

13
 import pygame
13
 import pygame
14
 
14
 
15
 class TestGUI:
15
 class TestGUI:
16
-    def __init__(self, width = 32 * 2, height = 32, multiplier = 16):
16
+    def __init__(self, width = 32 * 1, height = 32, multiplier = 16):
17
         self.width = width
17
         self.width = width
18
         self.height = height
18
         self.height = height
19
         self.multiplier = multiplier
19
         self.multiplier = multiplier

Loading…
Cancel
Save