猫史档案馆


【Python作品分享】表情包生成器【作品秀】

用户:可爱的编程猫哈哈的小号可爱的编程猫哈哈的小号查看:3 回复:5 评论:3 创建时间:2020-05-12T10:14:54


【作品展示】

center_image

 

【作品介绍】

制作表情。

 

【作品源代码】

import requests
import easygui as eg
from PIL import Image


# easygui窗口
title = '表情包生成器'
msg = '填写信息'
fieldName = ['原图片(含后缀)', '另存为(含后缀)', '添加文字', '文字大小', '文字位置(x轴)', '文字位置(y轴)']
fieldsValues = eg.multenterbox(msg,title,fieldName)
imgIn = fieldsValues[0]
imgOut = fieldsValues[1]
words = fieldsValues[2]
wordSize = int(fieldsValues[3])
wordX = int(fieldsValues[4])
wordY = int(fieldsValues[5])
# PIL
# 加载图片
img = Image.open(imgIn)
# 绘制Img对象
draw = ImageDraw.Draw(img)
# 创建字体
font = ImageFont.truetype("simhei.ttf",wordSize)
# 图像绘制字体
# 显示图片
img.show()
img.save(imgOut)

undefined.text

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
曾经热爱编程的人曾经热爱编程的人

信息怎么填,告诉我吧,我可以给你100源码币,如果告诉我了,你2天内会受到100源码币

点赞0


评论


曾经热爱编程的人曾经热爱编程的人

我用的是客户端的,求你了,我发出来没效果

点赞0


评论


AdogeAdoge

咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头用?咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头咋用?emotion_编程猫_搓头

点赞0


评论


AdogeAdoge

center_image

点赞0


评论


AdogeAdoge

运行不了…………

点赞0


评论