本文整理匯總了Python中SVGdraw.marker方法的典型用法代碼示例。如果您正苦於以下問題:Python SVGdraw.marker方法的具體用法?Python SVGdraw.marker怎麽用?Python SVGdraw.marker使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SVGdraw
的用法示例。
在下文中一共展示了SVGdraw.marker方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create
# 需要導入模塊: import SVGdraw [as 別名]
# 或者: from SVGdraw import marker [as 別名]
def create(self, color, head):
name = self._get_name(color, head)
if not self._markers.has_key(name):
if head:
marker = SVG.marker(name, (0,0,10,8), 0, 4, UNIT/4, UNIT/4,
fill=SvgColor(color), orient='auto')
marker.addElement(SVG.polyline(((0,4),(10,0),(10,8),(0,4))))
else:
marker = SVG.marker(name, (0,0,10,8), 10, 4, UNIT/4, UNIT/4,
fill=SvgColor(color), orient='auto')
marker.addElement(SVG.polyline(((0,0),(0,8),(10,4),(0,0))))
self._markers[name] = marker
return name
示例2: create
# 需要導入模塊: import SVGdraw [as 別名]
# 或者: from SVGdraw import marker [as 別名]
def create(self, color, head):
name = self._get_name(color, head)
if not self._markers.has_key(name):
# It seems that WebKit needs some adjustements ...
# xos = (3.0*UNIT/100)
# yos = (3.0*UNIT/100)
# ... but Gecko does not
xos = 0
yos = 0
if head:
marker = SVG.marker(name, (0,0,10,8), 0, 4, UNIT/4, UNIT/4,
fill=SvgColor(color), orient='auto')
marker.addElement(SVG.polyline(((0-xos,4-yos),(10-xos,0-yos),
(10-xos,8-yos),(0-xos,4-yos))))
else:
marker = SVG.marker(name, (0,0,10,8), 10, 4, UNIT/4, UNIT/4,
fill=SvgColor(color), orient='auto')
marker.addElement(SVG.polyline(((0+xos,0-yos),(0+xos,8-yos),
(10+xos,4-yos),(0+xos,0-yos))))
self._markers[name] = marker
return name