QQ群:476842922(欢迎加群讨论学习)
from PIL import Image, ImageDraw,ImageFont
Image1 = Image.open("aaa.jpg")
draw =ImageDraw.Draw(Image1)
for i in range(0,20):
draw.line((i*200+1,0 ,i*200, 1200), 'cyan')
for i in range(0,20):
draw.line((0,i*200 ,2000, i*200), 'cyan')
font = ImageFont.truetype("consola.ttf", 20, encoding="unic")#设置字
for i in range(0,20):
for j in range(0,20):
str1=str(i*200)
str2=str(j*200)
str3="["+str1+","+str2+"]"
draw.text((i*200, j*200), str3, 'fuchsia', font)
#draw.line((0,0) +Image1.size, fill=128)
Image1.show()
Image1.save("www.jpg", "JPEG")
直线画表格python PIL
最新推荐文章于 2022-08-01 17:27:45 发布