本文整理匯總了Python中pgmagick.api.Draw.stroke_antialias方法的典型用法代碼示例。如果您正苦於以下問題:Python Draw.stroke_antialias方法的具體用法?Python Draw.stroke_antialias怎麽用?Python Draw.stroke_antialias使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pgmagick.api.Draw
的用法示例。
在下文中一共展示了Draw.stroke_antialias方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __create_arrow_bg
# 需要導入模塊: from pgmagick.api import Draw [as 別名]
# 或者: from pgmagick.api.Draw import stroke_antialias [as 別名]
def __create_arrow_bg( self, points, color ):
"""
Create a draw of arrow background.
"""
draw = Draw()
draw.stroke_antialias( False )
draw.polygon( points )
draw.fill_color( color )
return draw
示例2: __create_arrow_border
# 需要導入模塊: from pgmagick.api import Draw [as 別名]
# 或者: from pgmagick.api.Draw import stroke_antialias [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_antialias [as 別名]
#.........這裏部分代碼省略.........
def test_round_rectangle(self):
self.d.round_rectangle(200, 200, 30, 30, 15, 15)
self.im.draw(self.d)
self.im.write('t.png')
def test_scaling(self):
self.d.scaling(0.4, 0.4)
self.d.circle(150, 150, 150, 200)
self.im.draw(self.d)
self.d = Draw()
self.d.fill_opacity(0.6)
self.d.circle(150, 150, 150, 200)
self.im.draw(self.d)
self.im.write('t.png')
def test_skew(self):
self.d = Draw()
self.d.fill_opacity(0.6)
self.d.circle(50, 50, 50, 100)
self.im.draw(self.d)
self.d = Draw()
self.d.fill_opacity(0.6)
self.d.circle(50, 50, 50, 100)
self.d.skewx(40)
self.im.draw(self.d)
self.d = Draw()
self.d.fill_opacity(0.6)
self.d.circle(50, 50, 50, 100)
self.d.skewy(40)
self.im.draw(self.d)
self.im.write('t.png')
def test_stroke_antialias(self):
self.d.stroke_color('black')
self.d.stroke_width(20)
self.d.stroke_antialias(True)
self.d.line(10, 10, 40, 200)
self.d.stroke_antialias(False)
self.d.line(50, 10, 80, 200)
self.im.draw(self.d)
self.im.write('t.png')
def test_stroke_linecap(self):
self.d.stroke_color('lime')
self.d.stroke_linecap('butt')
self.d.stroke_linecap('round')
self.d.stroke_linecap('square')
self.d.line(10, 10, 40, 200)
self.im.draw(self.d)
self.im.write('t.png')
def test_stroke_linejoin(self):
self.d.stroke_color('lime')
self.d.stroke_linejoin('round')
self.d.stroke_linejoin('bevel') # FIXME: Unit Test Error
self.d.stroke_linejoin('miter')
self.d.line(10, 10, 40, 200)
self.im.draw(self.d)
self.im.write('t.png')
def test_stroke_color(self):
self.d.stroke_color('lime')
self.d.line(10, 10, 40, 200)
self.im.draw(self.d)
self.im.write('t.png')