monsterhy123
 1 from PIL import Image,ImageDraw,ImageFont
 2 img = Image.new(\'RGB\',(300,300),\'white\')
 3 # img.show()
 4 # 绘制一个矩形
 5 draw_obj = ImageDraw.Draw(img)
 6 draw_obj.rectangle((50,50,200,200),fill=\'blue\',outline=\'red\')
 7 # draw_obj.text((60,80),\'Monsterlv\',fill=\'green\')
 8 font = ImageFont.truetype(\'SIMLI.TTF\',20)
 9 draw_obj.text((80,80),\'小怪兽\',font = font,fill=\'white\')
10 img.show()

 

分类:

技术点:

相关文章:

  • 2021-12-12
  • 2021-12-26
  • 2021-11-11
  • 2021-04-08
  • 2021-11-18
  • 2021-12-16
猜你喜欢
  • 2021-11-11
  • 2021-12-09
  • 2021-12-12
  • 2021-11-11
  • 2021-12-01
  • 2021-08-14
  • 2021-12-07
相关资源
相似解决方案