MCPcopy Create free account
hub / github.com/ActiveState/code / put

Function put

recipes/Python/498151_Example_For_winreg_2/recipe-498151.py:148–155  ·  view source on GitHub ↗
(media, image, x, y)

Source from the content-addressed store, hash-verified

146os.chdir(os.path.dirname(sys.argv[0]))
147
148def 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
157def files():
158 return [os.path.join(os.getcwd(), 'images', name) for name in os.listdir(os.path.join(os.getcwd(), 'images'))]

Callers 2

applyMethod · 0.70
do_setupFunction · 0.70

Calls 2

widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected