本文整理匯總了Python中FlagPainter.FlagPainter.place_drawing方法的典型用法代碼示例。如果您正苦於以下問題:Python FlagPainter.place_drawing方法的具體用法?Python FlagPainter.place_drawing怎麽用?Python FlagPainter.place_drawing使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FlagPainter.FlagPainter
的用法示例。
在下文中一共展示了FlagPainter.place_drawing方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: paint_flag_andorra
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_andorra():
f = FlagPainter(7 / 10)
colors = [(28, 63, 148), (255, 238, 0), (237, 22, 79)]
ratios = [64, 72, 64]
f.stripes(colors, ratios, StripeDirection.vertical)
f.place_drawing('andorra_detail.png', (1 / 2, 1 / 2), (62 / 200, 66 / 140))
f.save('andorra')
示例2: paint_flag_cyprus
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_cyprus():
"""http://www.vexilla-mundi.com/cyprus_flag.html"""
f = FlagPainter(2 / 3)
white = (255, 255, 255)
f.background(white)
f.place_drawing('cyprus_detail.png', center=(9.5 / 18, 5.75 / 12), size=(10 / 18, 8.5 / 12))
f.save('cyprus')
示例3: paint_flag_montenegro
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_montenegro():
"""http://www.vexilla-mundi.com/montenegro_flag.html"""
f = FlagPainter(1 / 2)
colors = [(283, 12, 43), (254, 191, 37)]
f.background(colors[1])
f.draw_rectangle(box=(3 / 120, 3 / 60, 1 - 3 / 120, 1 - 3 / 60), color=colors[0])
f.place_drawing('montenegro_detail', (1 / 2, 1 / 2), (None, 40 / 60))
f.save('montenegro')
示例4: paint_flag_vatican_city
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_vatican_city():
"""http://www.vexilla-mundi.com/vatican_flag.html"""
f = FlagPainter(1)
colors = [(254, 220, 17), (255, 255, 255)]
ratios = [1, 1]
f.stripes(colors, ratios, StripeDirection.vertical)
f.place_drawing('vatican_city_detail', (27 / 36, 18 / 36), (13 / 36, 20 / 36))
f.save('vatican_city')
示例5: paint_flag_switzerland_fashioncheque
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_switzerland_fashioncheque():
"""http://vexilla-mundi.com/switserland_flag.html"""
f = FlagPainter(2 / 3)
colors = [(197, 5, 50), (255, 255, 255)]
f.background(colors[0])
f.place_drawing('switzerland', center=(1 / 2, 1 / 2), size=(None, 1))
f.save('switzerland_fashioncheque')
示例6: paint_flag_slovenia
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_slovenia():
"""http://www.vexilla-mundi.com/slovenia_flag.html"""
f = FlagPainter(1 / 2)
colors = [(255, 255, 255), (4, 49, 157), (203, 0, 44)]
ratios = [1, 1, 1]
f.stripes(colors, ratios, StripeDirection.horizontal)
f.place_drawing('slovenia_detail', (63 / 252, 42 / 126), (32 / 252, 42 / 126))
f.save('slovenia')
示例7: paint_flag_spain
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_spain():
""""""
f = FlagPainter(2 / 3)
colors = [(190, 0, 36), (254, 194, 14), (190, 0, 36)]
ratios = [1, 2, 1]
f.stripes(colors, ratios, StripeDirection.horizontal)
f.place_drawing('spain_detail.png', (20 / 60, 1 / 2), (16 / 60, 16 / 40))
f.save('spain')
示例8: paint_flag_serbia
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_serbia():
"""http://www.vexilla-mundi.com/serbia_flag.html"""
f = FlagPainter(2 / 3)
colors = [(223, 0, 56), (0, 25, 98), (255, 255, 255)]
ratios = [1, 1, 1]
f.stripes(colors, ratios, StripeDirection.horizontal)
f.place_drawing('serbia_detail', (321.5 / 900, 275 / 600), (225 / 900, 450 / 600))
f.save('serbia')
示例9: paint_flag_slovakia
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_slovakia():
"""http://www.vexilla-mundi.com/slovakia_flag.html"""
f = FlagPainter(2 / 3)
colors = [(255, 255, 255), (0, 36, 151), (190, 0, 36)]
ratios = [1, 1, 1]
f.stripes(colors, ratios, StripeDirection.horizontal)
f.place_drawing('slovakia_detail', (270 / 900, 300 / 600), (240 / 900, 318 / 600))
f.save('slovakia')
示例10: paint_flag_portugal
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_portugal():
"""http://www.vexilla-mundi.com/portugal_flag.html"""
f = FlagPainter(2 / 3)
colors = [(209, 17, 24), (11, 87, 46)]
ratios = [2, 3]
f.stripes(colors, ratios, StripeDirection.vertical)
f.place_drawing('portugal_detail.png', (2 / 5, 1 / 2), (None, 1 / 2))
f.save('portugal')
示例11: paint_flag_moldova
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_moldova():
"""http://www.vexilla-mundi.com/moldova_flag.html"""
f = FlagPainter(1 / 2)
colors = [(4, 49, 157), (254, 194, 14), (193, 0, 32)]
ratios = [1, 1, 1]
f.stripes(colors, ratios, StripeDirection.vertical)
f.place_drawing('moldova_detail', (1 / 2, 1 / 2), (168 / 600, 168 / 300))
f.save('moldova')
示例12: paint_flag_malta
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_malta():
"""http://www.vexilla-mundi.com/malta_flag.html"""
f = FlagPainter(2 / 3)
colors = [(255, 255, 255), (190, 0, 36)]
ratios = [1, 1]
f.stripes(colors, ratios, StripeDirection.vertical)
f.place_drawing('malta_detail', (95 / 810, 95 / 540), (150 / 810, 150 / 540))
f.save('malta')
示例13: paint_flag_belarus
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_belarus():
f = FlagPainter(1 / 2)
colors = [(213, 39, 34), (46, 174, 103)]
white = (255, 255, 255)
ratios = [2, 1]
f.stripes(colors, ratios, StripeDirection.horizontal)
f.draw_vertical_band((0, 70 / 630), white)
f.place_drawing('belarus_detail.png', center=(35 / 630, 1 / 2), size=(70 / 630, 1))
f.save('belarus')
示例14: paint_flag_liechtenstein
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_liechtenstein():
"""http://www.vexilla-mundi.com/liechtenstein_flag.html"""
f = FlagPainter(3 / 5)
colors = [(0, 36, 151), (190, 0, 36)]
ratios = [1, 1]
f.stripes(colors, ratios, StripeDirection.horizontal)
f.place_drawing(img_name='liechtenstein_detail', center=(8 / 40, 6 / 24),
size=(8 / 40, 6 / 24))
f.save('liechtenstein')
示例15: paint_flag_croatia
# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import place_drawing [as 別名]
def paint_flag_croatia():
f = FlagPainter(1 / 2)
colors = [(255, 0, 0), (255, 255, 255), (23, 61, 174)]
ratios = [1, 1, 1]
f.stripes(colors, ratios, StripeDirection.horizontal)
W = 6 / 5 * 10 / 48
H = 795 / 600 * W / (f.height / f.width)
upper = 1 / 3 - 250 / 795 * H
lower = 1 / 3 + 545 / 795 * H
f.place_drawing('croatia_detail.png', center=(1 / 2, (upper + lower) / 2), size=(W, H))
f.save('croatia')