本文整理汇总了Python中graphics.Graphics.make_image方法的典型用法代码示例。如果您正苦于以下问题:Python Graphics.make_image方法的具体用法?Python Graphics.make_image怎么用?Python Graphics.make_image使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类graphics.Graphics
的用法示例。
在下文中一共展示了Graphics.make_image方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: due_picture
# 需要导入模块: from graphics import Graphics [as 别名]
# 或者: from graphics.Graphics import make_image [as 别名]
def due_picture():
data_list = db.run_query("due.sql")
new_list = DueDate.time_converter(data_list)
return_list = DueDate.make_dict(new_list)
Graphics.setup(mode="RGBA", size=(1024, 1024), color=(255, 255, 255, 200))
Graphics.make_image(return_list, "due.png")
示例2: DataManager
# 需要导入模块: from graphics import Graphics [as 别名]
# 或者: from graphics.Graphics import make_image [as 别名]
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
from datamanager import DataManager
from graphics import Graphics
from due import DueDate
db = DataManager()
db.create_tables("base_data.sql")
data_list = db.run_query("due.sql")
new_list = DueDate.time_converter(data_list)
return_list = DueDate.make_dict(new_list)
Graphics.setup(mode="RGB", size=(1024, 1024), color=(255, 255, 255))
Graphics.make_image(return_list, "due.png")
示例3: text_color
# 需要导入模块: from graphics import Graphics [as 别名]
# 或者: from graphics.Graphics import make_image [as 别名]
y += 100
font_size -= 10
text_options = {
'xy': (x, y),
'fill': text_color(row[1][1]),
'font': ImageFont.truetype("SourceSansPro-Regular.otf", font_size),
'text': row[1][0]
}
print(text_options)
result.append(text_options)
return result
def text_color(hexa):
try:
value = hexa.lstrip('#')
colors = [int(v, 16)*17 for v in (x for x in value)]
RGB_list = (0, colors[0], colors[1], colors[2])
return RGB_list
except AttributeError:
RGB_list = (0, 255, 255, 255)
return RGB_list
Graphics.setup(mode="RGBA", size=(1024, 1024), color="white")
Graphics.make_image(text_size(), "ooooooo.png")
开发者ID:CodecoolBP20161,项目名称:python-data-visualisation-dog-five,代码行数:32,代码来源:10_biggest_eur_projects_runner.py
示例4: biggest_picture
# 需要导入模块: from graphics import Graphics [as 别名]
# 或者: from graphics.Graphics import make_image [as 别名]
def biggest_picture():
data_list = BiggestEurProjects('10-biggest-eur-projects-company.sql')
return_list = data_list.text_size()
Graphics.setup(mode="RGB", size=(1024, 1024), color="black")
Graphics.make_image(return_list, "biggest-project.png")
print(pict_ready)
示例5: all_clients_picture
# 需要导入模块: from graphics import Graphics [as 别名]
# 或者: from graphics.Graphics import make_image [as 别名]
def all_clients_picture():
clients_rgb = all_clients.hex_to_rgb(all_clients.clients, all_clients.clients_colors)
all_clients.rgb_dic(clients_rgb)
dic_list = all_clients.rgb_dic(clients_rgb)
Graphics.setup(mode="RGB", size=(1024, 1024), color="black")
Graphics.make_image(dic_list, 'all_clients.png')
示例6: project_name_picture
# 需要导入模块: from graphics import Graphics [as 别名]
# 或者: from graphics.Graphics import make_image [as 别名]
def project_name_picture():
data_list = ProjctNumberRunner('project-names.sql')
return_list = data_list.dict_to_image()
Graphics.setup(mode="RGB", size=(1024, 1024), color="black")
Graphics.make_image(return_list, "project-names.png")
print(pict_ready)
示例7: rgb_dic
# 需要导入模块: from graphics import Graphics [as 别名]
# 或者: from graphics.Graphics import make_image [as 别名]
return clients_rgb
def rgb_dic(clients_rgb):
name_list = []
dic_list = []
for i in clients_rgb:
x = random.randint(0, 1024)
y = random.randint(0, 1024)
z = random.randint(15, 150)
if i[0] not in name_list:
name_list.append(i[0])
dic_list.append(
{
"xy": (x, y),
"font": ImageFont.truetype("SourceSansPro-Regular.otf", y),
"text": i[0],
"fill": tuple(i[1]),
}
)
# print(dic_list)
return dic_list
clients_rgb = hex_to_rgb(clients, clients_colors)
rgb_dic(clients_rgb)
dic_list = rgb_dic(clients_rgb)
Graphics.setup(mode="RGB", size=(1024, 1024), color="black")
Graphics.make_image(dic_list, "all_clients.png")