本文整理匯總了Python中pgmagick.api.Draw.stroke_opacity方法的典型用法代碼示例。如果您正苦於以下問題:Python Draw.stroke_opacity方法的具體用法?Python Draw.stroke_opacity怎麽用?Python Draw.stroke_opacity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pgmagick.api.Draw
的用法示例。
在下文中一共展示了Draw.stroke_opacity方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: DrawTestCase
# 需要導入模塊: from pgmagick.api import Draw [as 別名]
# 或者: from pgmagick.api.Draw import stroke_opacity [as 別名]
#.........這裏部分代碼省略.........
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.)
self.d.circle(150, 150, 50, 180)
self.im.draw(self.d.drawer)
self.im.write('t.png')
def test_polygon(self):
coordinate = ((10, 10), (20, 30), (40, 50))
self.d.polygon(coordinate)
coordinate = [(100, 100), (150, 100), [150, 150], (100, 150)]
self.d.polygon(coordinate)