本文整理汇总了Python中nodebox.graphics.Path.ellipse方法的典型用法代码示例。如果您正苦于以下问题:Python Path.ellipse方法的具体用法?Python Path.ellipse怎么用?Python Path.ellipse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nodebox.graphics.Path
的用法示例。
在下文中一共展示了Path.ellipse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_circle
# 需要导入模块: from nodebox.graphics import Path [as 别名]
# 或者: from nodebox.graphics.Path import ellipse [as 别名]
def parse_circle(e):
x = float(get_attribute(e, "cx"))
y = float(get_attribute(e, "cy"))
r = float(get_attribute(e, "r"))
p = Path()
p.ellipse(x, y, r*2, r*2)
p.close()
return p
示例2: parse_oval
# 需要导入模块: from nodebox.graphics import Path [as 别名]
# 或者: from nodebox.graphics.Path import ellipse [as 别名]
def parse_oval(e):
x = float(get_attribute(e, "cx"))
y = float(get_attribute(e, "cy"))
w = float(get_attribute(e, "rx"))*2
h = float(get_attribute(e, "ry"))*2
p = Path()
p.ellipse(x, y, w, h)
p.close()
return p
示例3: parse_circle
# 需要导入模块: from nodebox.graphics import Path [as 别名]
# 或者: from nodebox.graphics.Path import ellipse [as 别名]
def parse_circle(e):
cx = float(get_attribute(e, "cx"))
cy = float(get_attribute(e, "cy"))
r = float(get_attribute(e, "r"))
if r < 0:
print >> sys.stderr, "Error: invalid negative value for <circle> attribute r=\"%s\"" % r
r = 0
p = Path()
p.ellipse(cx, cy, r*2, r*2)
p.close()
return p
示例4: parse_ellipse
# 需要导入模块: from nodebox.graphics import Path [as 别名]
# 或者: from nodebox.graphics.Path import ellipse [as 别名]
def parse_ellipse(e):
cx = float(get_attribute(e, "cx"))
cy = float(get_attribute(e, "cy"))
rx = float(get_attribute(e, "rx"))
ry = float(get_attribute(e, "ry"))
if rx < 0:
print >> sys.stderr, "Error: invalid negative value for <ellipse> attribute rx=\"%s\"" % rx
rx = 0
if ry < 0:
print >> sys.stderr, "Error: invalid negative value for <ellipse> attribute ry=\"%s\"" % ry
ry = 0
p = Path()
p.ellipse(cx, cy, rx * 2, ry * 2)
p.close()
return p
示例5: ellipse
# 需要导入模块: from nodebox.graphics import Path [as 别名]
# 或者: from nodebox.graphics.Path import ellipse [as 别名]
def ellipse(position, width, height):
p = Path()
p.ellipse(position.x, position.y, width, height)
return p