1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
| #!c:\python26\python.exe
import Image, ImageDraw
im = Image.open('wire.png')
tmp = Image.new('RGB', (100, 100), 'black')
def first(pos, posX, posY, round):
for x in range(posX):
data = im.getpixel((x+pos, 0))
tmp.putpixel((posY-1, x+round), data)
def second(pos, posX, posY, round):
count = posX - 1
for x in range(posX):
data = im.getpixel((x+pos, 0))
tmp.putpixel((count+round, posY), data)
count -= 1
def third(pos, posX, round):
count = posX - 1
for x in range(posX):
data = im.getpixel((x+pos, 0))
tmp.putpixel((round, count+round), data)
count -= 1
def fourth(pos, posX, round):
for x in range(posX):
data = im.getpixel((x+pos, 0))
tmp.putpixel((x+1+round, round), data)
pos = 0
x = 100
y = 100
for round in range(50):
first(pos, x, y, round)
pos += x
x -= 1
y -= 1
second(pos, x, y, round)
pos += x
third(pos, x, round)
pos += x
x -= 1
fourth(pos, x, round)
pos += x
tmp.show()
|