本文整理汇总了Python中pgmagick.api.Draw.stroke_color方法的典型用法代码示例。如果您正苦于以下问题:Python Draw.stroke_color方法的具体用法?Python Draw.stroke_color怎么用?Python Draw.stroke_color使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pgmagick.api.Draw
的用法示例。
在下文中一共展示了Draw.stroke_color方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: draw_rectangle
# 需要导入模块: from pgmagick.api import Draw [as 别名]
# 或者: from pgmagick.api.Draw import stroke_color [as 别名]
def draw_rectangle(self, x, y, width, height):
draw = Draw()
draw.fill_opacity(0.0)
draw.stroke_color('white')
draw.stroke_width(1)
draw.rectangle(x, y, x + width, y + height)
self.image.draw(draw.drawer)
示例2: __create_arrow_border
# 需要导入模块: from pgmagick.api import Draw [as 别名]
# 或者: from pgmagick.api.Draw import stroke_color [as 别名]
def __create_arrow_border( self, start_x, end_x , y, arrow_height, color ):
"""
Create a draw of arrow border.
"""
center_x = ( start_x + end_x ) /2
center_y = arrow_height + y
arrow_border_draw = Draw()
arrow_border_draw.stroke_color( color )
arrow_border_draw.stroke_antialias( False )
arrow_border_draw.line( start_x, y, center_x, center_y )
arrow_border_draw.line( center_x, center_y, end_x, y )
arrow_border_draw.stroke_width( 2 )
return arrow_border_draw
示例3: DrawTestCase
# 需要导入模块: from pgmagick.api import Draw [as 别名]
# 或者: from pgmagick.api.Draw import stroke_color [as 别名]
#.........这里部分代码省略.........
self.im.draw(self.d)
self.im.write('t.png')
def test_font_weight100(self):
self.d.font('vera.ttf', weight=100)
self.d.text(30, 30, "hello pgmagick")
self.im.draw(self.d)
self.im.write('t.png')
def test_font_bold(self):
self.d.font('vera.ttf', weight='bold')
self.d.text(30, 30, "hello pgmagick")
self.im.draw(self.d)
self.im.write('t.png')
def test_gravity(self):
self.d.gravity('center')
self.d.text(0, 0, "hello pgmagick")
self.im.draw(self.d)
self.im.write('t.png')
def test_line(self):
self.d.line(10, 10, 40, 200)
self.im.draw(self.d)
self.im.write('t.png')
def test_matte(self):
self.d.matte(30, 30, 'filltoborder')
self.im.draw(self.d)
self.im.write('t.png')
def test_miterlimit(self):
self.d.miterlimit(0)
self.d.stroke_color('black')
self.d.stroke_width(3)
self.d.line(10, 200, 100, 10)
self.d.line(100, 10, 210, 200)
self.im.draw(self.d)
self.d = Draw()
self.d.miterlimit(18)
self.d.stroke_color('black')
self.d.stroke_width(3)
self.d.stroke_opacity(0.5)
self.d.fill_opacity(0.5)
self.d.line(210, 200, 300, 10)
self.d.line(300, 10, 410, 200)
self.im.draw(self.d)
self.im.write('t.png')
def test_path(self):
paths = ((40, 30),)
self.d.path(paths)
self.im.draw(self.d.drawer)
self.im.write('t.png')
def test_point(self):
for i in range(50):
self.d.point(i, i + 10)
for i in range(50, 200, 2):
self.d.point(i, i + 10)
self.im.draw(self.d.drawer)
self.im.write('t.png')
def test_pointsize(self):
self.d.pointsize(10)
self.d.pointsize(30.)