| 146 | os.chdir(os.path.dirname(sys.argv[0])) |
| 147 | |
| 148 | def put(media, image, x, y): |
| 149 | media_w, media_h = int(media.config()['width'][-1]), int(media.config()['height'][-1]) |
| 150 | start_w, start_h = image.width() / 2, image.height() / 2 |
| 151 | stop_w, stop_h = media_w - start_w, media_h - start_h |
| 152 | position = (stop_w - start_w) * x + start_w, (stop_h - start_h) * y + start_h |
| 153 | handle = media.create_image(position, image=image) |
| 154 | reference[handle] = image |
| 155 | return handle |
| 156 | |
| 157 | def files(): |
| 158 | return [os.path.join(os.getcwd(), 'images', name) for name in os.listdir(os.path.join(os.getcwd(), 'images'))] |