Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a61c11b

Browse files
committed
0000
1 parent 624a843 commit a61c11b

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

wssywh/0000/0000.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#coding:utf-8
2+
#第 0000 题:将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果。
3+
from PIL import Image, ImageDraw, ImageFont
4+
5+
__author__ = 'Hunter'
6+
7+
def picture_num(img,num):
8+
im = ImageDraw.Draw(img)
9+
print(img.size)
10+
numFont = ImageFont.truetype("ahronbd.ttf",300)
11+
im.text((260, -50), num, fill=(255, 0, 0),font=numFont)
12+
img.save("wechat_100.jpg")
13+
img.show()
14+
15+
16+
if __name__ == '__main__':
17+
img = Image.open("wechat.jpg")
18+
picture_num(img,"100")

wssywh/0000/ahronbd.ttf

49.3 KB
Binary file not shown.

wssywh/0000/wechat.jpg

22 KB
Loading

wssywh/0000/wechat_100.jpg

32.8 KB
Loading

0 commit comments

Comments
 (0)