题目网站 https://github.com/Yixiaohan/show-me-the-code
0000题答案
from PIL import Image,ImageFont,ImageDraw im=Image.open('bg.png') (width,height)=im.size draw=ImageDraw.Draw(im) newfont=ImageFont.truetype('simkai.ttf',50) draw.text((width-40,20),'4',(255,0,0),font=newfont) #Question
#有没有更好的方法在右上角显示
#PIL 文档见:http://pillow-cn.readthedocs.io/zh_CN/latest/index.html 后续有需要请查找
#有关pillow的一些小例子便于学习:http://blog.youkuaiyun.com/Richie_ll/article/details/69206210
本文介绍了一种利用Python的PIL库在图片右上角添加红色数字的方法,并附带了完整的代码示例。此外,还提供了PIL库的相关资源链接以便于读者进一步学习。
7863

被折叠的 条评论
为什么被折叠?



