Skip to content

Commit 21a5921

Browse files
committed
creat_image
1 parent e5aa53d commit 21a5921

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

python_game/5.image/all_colors.bmp

12 MB
Binary file not shown.

python_game/5.image/creat_image.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import pygame
2+
pygame.init()
3+
4+
screen = pygame.display.set_mode((640,480))
5+
6+
all_colors = pygame.Surface((2048,2048),depth = 24)
7+
8+
for r in xrange(256):
9+
print r+1,"out of 256"
10+
x = (r&15)*256
11+
y = (r>>4)*256
12+
for g in xrange(256):
13+
for b in xrange(256):
14+
all_colors.set_at((x+g,y+b),(r,g,b))
15+
16+
pygame.image.save(all_colors, "all_colors.bmp")

python_game/5.image/draw.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pyg:q
2+

0 commit comments

Comments
 (0)