Skip to content

Commit 5cf2f17

Browse files
committed
task 0000 added
1 parent 467169c commit 5cf2f17

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎agmcs/0000/0000.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from PIL import Image, ImageDraw, ImageFont
2+
text = "52"
3+
im = Image.open('1.bmp')
4+
w,h = im.size
5+
font_size = h//4
6+
7+
draw = ImageDraw.Draw(im)
8+
font = ImageFont.truetype ("Arial.ttf",font_size)
9+
10+
text_w,text_h = draw.textsize(text,font=font)
11+
draw.text((w-text_w,0), text, fill=(255,0,0), font=font)
12+
13+
14+
im.save('heihei.bmp')

‎agmcs/0000/1.bmp‎

1.02 MB
Binary file not shown.

0 commit comments

Comments
 (0)