當前位置: 首頁>>代碼示例>>Python>>正文


Python FlagPainter.save方法代碼示例

本文整理匯總了Python中FlagPainter.FlagPainter.save方法的典型用法代碼示例。如果您正苦於以下問題:Python FlagPainter.save方法的具體用法?Python FlagPainter.save怎麽用?Python FlagPainter.save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FlagPainter.FlagPainter的用法示例。


在下文中一共展示了FlagPainter.save方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: paint_flag_poland

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [as 別名]
def paint_flag_poland():
    """http://www.vexilla-mundi.com/poland_flag.html"""
    f = FlagPainter(5 / 8)
    colors = [(255, 255, 255), (198, 8, 32)]
    ratios = [1, 1]
    f.stripes(colors, ratios, StripeDirection.horizontal)
    f.save('poland')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:9,代碼來源:FlagRecipes.py

示例2: paint_flag_cyprus

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [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')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:9,代碼來源:FlagRecipes.py

示例3: paint_flag_romania

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [as 別名]
def paint_flag_romania():
    """http://www.vexilla-mundi.com/romania_flag.html"""
    f = FlagPainter(2 / 3)
    colors = [(0, 25, 98), (254, 194, 14), (190, 0, 36)]
    ratios = [1, 1, 1]
    f.stripes(colors, ratios, StripeDirection.vertical)
    f.save('romania')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:9,代碼來源:FlagRecipes.py

示例4: paint_flag_netherlands

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [as 別名]
def paint_flag_netherlands():
    """http://www.vexilla-mundi.com/netherlands_flag.html"""
    f = FlagPainter(2 / 3)
    colors = [(190, 0, 36), (255, 255, 255), (0, 36, 151)]
    ratios = [1, 1, 1]
    f.stripes(colors, ratios, StripeDirection.horizontal)
    f.save('netherlands')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:9,代碼來源:FlagRecipes.py

示例5: paint_flag_russia

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [as 別名]
def paint_flag_russia():
    """http://www.vexilla-mundi.com/russia_flag.html"""
    f = FlagPainter(2 / 3)
    colors = [(255, 255, 255), (4, 49, 157), (209, 17, 24)]
    ratios = [1, 1, 1]
    f.stripes(colors, ratios, StripeDirection.horizontal)
    f.save('russia')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:9,代碼來源:FlagRecipes.py

示例6: paint_flag_monaco

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [as 別名]
def paint_flag_monaco():
    """http://www.vexilla-mundi.com/monaco_flag.html"""
    f = FlagPainter(4 / 5)
    colors = [(190, 0, 36), (255, 255, 255)]
    ratios = [1, 1]
    f.stripes(colors, ratios, StripeDirection.horizontal)
    f.save('monaco')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:9,代碼來源:FlagRecipes.py

示例7: paint_flag_ukraine

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [as 別名]
def paint_flag_ukraine():
    """http://www.vexilla-mundi.com/ukraine_flag.html"""
    f = FlagPainter(2 / 3)
    colors = [(6, 68, 173), (253, 207, 15)]
    ratios = [1, 1]
    f.stripes(colors, ratios, StripeDirection.horizontal)
    f.save('ukraine')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:9,代碼來源:FlagRecipes.py

示例8: paint_flag_lithuania

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [as 別名]
def paint_flag_lithuania():
    """http://www.vexilla-mundi.com/lithuania_flag.html"""
    f = FlagPainter(3 / 5)
    colors = [(253, 168, 17), (11, 87, 46), (178, 37, 37)]
    ratios = [1, 1, 1]
    f.stripes(colors, ratios, StripeDirection.horizontal)
    f.save('lithuania')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:9,代碼來源:FlagRecipes.py

示例9: paint_flag_united_kingdom

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [as 別名]
def paint_flag_united_kingdom():
    """http://www.vexilla-mundi.com/united_kingdom_flag.html"""
    f = FlagPainter(1 / 2)
    colors = [(0, 36, 125), (207, 20, 43), (255, 255, 255)]

    # Background color
    f.background(colors[0])

    # White diagonal stripes
    X = (1 / math.cos(math.pi / 3)) / 60
    Y = (1 / math.cos(math.pi / 6)) / 30
    points = [(0, 0), (0, 3 * Y), (1 - 3 * X, 1), (1, 1), (1, 1 - 3 * Y), (3 * X, 0)]
    f.draw_polygon(points, colors[2])
    points = [(1, 0), (1 - 3 * X, 0), (0, 1 - 3 * Y), (0, 1), (3 * X, 1), (1, 3 * Y)]
    f.draw_polygon(points, colors[2])

    # Red diagonal stripes
    points = [(0, 0), (0, 2 * Y), ((20 / 60) - 2 * X, 10 / 30), (20 / 60, 10 / 30)]
    f.draw_polygon(points, colors[1])
    points = [(1, 0), (1 - 2 * X, 0), (1 - (20 / 60) - 2 * X, 10 / 30), (1 - (20 / 60), 10 / 30)]
    f.draw_polygon(points, colors[1])
    points = [(1, 1), (1, 1 - 2 * Y), (1 - (20 / 60) + 2 * X, 1 - (10 / 30)),
              (1 - (20 / 60), 1 - (10 / 30))]
    f.draw_polygon(points, colors[1])
    points = [(0, 1), (2 * X, 1), (20 / 60 + 2 * X, 1 - (10 / 30)), (20 / 60, 1 - (10 / 30))]
    f.draw_polygon(points, colors[1])

    # Horizontal and vertical stripes
    f.draw_horizontal_band((10 / 30, 20 / 30), colors[2])
    f.draw_vertical_band((25 / 60, 35 / 60), colors[2])
    f.draw_horizontal_band((12 / 30, 18 / 30), colors[1])
    f.draw_vertical_band((27 / 60, 33 / 60), colors[1])

    f.save('united_kingdom')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:36,代碼來源:FlagRecipes.py

示例10: paint_flag_andorra

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [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')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:9,代碼來源:FlagRecipes.py

示例11: paint_flag_montenegro

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [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')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:10,代碼來源:FlagRecipes.py

示例12: paint_flag_moldova

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [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')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:10,代碼來源:FlagRecipes.py

示例13: paint_flag_malta

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [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')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:10,代碼來源:FlagRecipes.py

示例14: paint_flag_latvia

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [as 別名]
def paint_flag_latvia():
    """http://www.vexilla-mundi.com/latvia_flag.html"""
    f = FlagPainter(5 / 10)
    colors = [(143, 32, 43), (255, 255, 255)]
    ratios = [2, 1, 2]
    f.stripes(colors=[colors[0], colors[1], colors[0]], ratios=ratios,
              stripe_direction=StripeDirection.horizontal)
    f.save('latvia')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:10,代碼來源:FlagRecipes.py

示例15: paint_flag_finland

# 需要導入模塊: from FlagPainter import FlagPainter [as 別名]
# 或者: from FlagPainter.FlagPainter import save [as 別名]
def paint_flag_finland():
    """http://www.crwflags.com/fotw/flags/fi.html"""
    f = FlagPainter(11 / 18)
    colors = [(255, 255, 255), (0, 51, 153)]
    f.background(colors[0])
    f.draw_horizontal_band((4 / 11, 7 / 11), colors[1])
    f.draw_vertical_band((5 / 18, 8 / 18), colors[1])
    f.save('finland')
開發者ID:physicalattraction,項目名稱:PythonPainting,代碼行數:10,代碼來源:FlagRecipes.py


注:本文中的FlagPainter.FlagPainter.save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。