python画正⽅形的代码drawingpanel_Pythonshapes.Drawin。
。。
本⽂整理汇总了Python中aphics.shapes.Drawing⽅法的典型⽤法代码⽰例。如果您正苦于以下问题:Python
shapes.Drawing⽅法的具体⽤法?Python shapes.Drawing怎么⽤?Python shapes.Drawing使⽤的例⼦?那么恭喜您, 这⾥精选的⽅法代码⽰例或许可以为您提供帮助。您也可以进⼀步了解该⽅法所在模块aphics.shapes的⽤法⽰例。
在下⽂中⼀共展⽰了shapes.Drawing⽅法的42个代码⽰例,这些例⼦默认根据受欢迎程度排序。您可以为喜欢或者感觉有⽤的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码⽰例。
⽰例1: test_11_drawing
点赞 4
# 需要导⼊模块: aphics import shapes [as 别名]
# 或者: aphics.shapes import Drawing [as 别名]
def test_11_drawing(self):
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib import colors
from reportlab.platypus import SimpleDocTemplate, Spacer, Paragraph
from reportlab.pdfbase import pdfmetrics
aphics.shapes import Drawing, Rect
from fonts import TTFont
python代码画图案
stylesheet = getSampleStyleSheet()
elements = []
doc = SimpleDocTemplate("demo.pdf")
elements.append(Paragraph('JY.zenist.song - ??', stylesheet['Title']))
elements.append(Spacer(1,12))
d = Drawing(400,200)
d.add(Rect(50,50,300,100, llow))
elements.append(d)
doc.build(elements)
开发者ID:zenist,项⽬名称:ZLib,代码⾏数:24,
⽰例2: demo
点赞 3
# 需要导⼊模块: aphics import shapes [as 别名]
# 或者: aphics.shapes import Drawing [as 别名] def demo(self):
"""This shows a label positioned with its top right corner
at the top centre of the drawing, and rotated 45 degrees."""
d = Drawing(200, 100)
# mark the origin of the label
d.add(Circle(100,90, 5, ))fwtools
lab = Label()
lab.setOrigin(100,90)
lab.boxAnchor = 'ne'
lab.angle = 45
lab.dx = 0
lab.dy = -20
lab.boxStrokeColor =
lab.setText('Another\nMulti-Line\nString')
d.add(lab)
return d
开发者ID:aragos,项⽬名称:tichu-tournament,代码⾏数:22,
⽰例3: demo
点赞 3
# 需要导⼊模块: aphics import shapes [as 别名] # 或者: aphics.shapes import Drawing [as 别名] def demo(self):
"Make sample legend."
d = Drawing(200, 100)
legend = Legend()
legend.alignment = 'left'
legend.x = 0
legend.y = 100
legend.dxTextSpace = 5
items = 'red green blue yellow pink black white'.split()
items = [(getattr(colors, i), i) for i in items]
d.add(legend, 'legend')
return d
开发者ID:aragos,项⽬名称:tichu-tournament,代码⾏数:19,
⽰例4: sample2c
点赞 3
# 需要导⼊模块: aphics import shapes [as 别名] # 或者: aphics.shapes import Drawing [as 别名] def sample2c():
"Make sample legend."
d = Drawing(200, 100)
legend = Legend()
legend.alignment = 'right'
legend.x = 20
legend.y = 90
retain用法legend.deltax = 60
legend.dxTextSpace = 10
items = 'red green blue yellow pink black white'.split()
items = [(getattr(colors, i), i) for i in items]
d.add(legend, 'legend')
return d
开发者ID:aragos,项⽬名称:tichu-tournament,代码⾏数:21,
⽰例5: sample3
点赞 3
# 需要导⼊模块: aphics import shapes [as 别名] # 或者: aphics.shapes import Drawing [as 别名] def sample3():
"Make sample legend with line swatches."
d = Drawing(200, 100)
legend = LineLegend()
legend.alignment = 'right'
legend.x = 20
legend.y = 90
legend.deltax = 60
legend.dxTextSpace = 10
items = 'red green blue yellow pink black white'.split()
items = [(getattr(colors, i), i) for i in items]
d.add(legend, 'legend')
return d
开源论坛网站
开发者ID:aragos,项⽬名称:tichu-tournament,代码⾏数:20,
⽰例6: sample3a
点赞 3
# 需要导⼊模块: aphics import shapes [as 别名]
# 或者: aphics.shapes import Drawing [as 别名]
def sample3a():
"Make sample legend with line swatches and dasharrays on the lines."
d = Drawing(200, 100)
legend = LineLegend()
legend.alignment = 'right'浮点运算对阶
legend.x = 20clothes可数吗?
legend.y = 90
legend.deltax = 60
legend.dxTextSpace = 10
items = 'red green blue yellow pink black white'.split()
darrays = ([2,1], [2,5], [2,2,5,5], [1,2,3,4], [4,2,3,4], [1,2,3,4,5,6], [1]) cnp = []
for i in range(0, len(items)):
l = LineSwatch()
l.strokeColor = getattr(colors, items[i])
l.strokeDashArray = darrays[i]
cnp.append((l, items[i]))
d.add(legend, 'legend')
return d
开发者ID:aragos,项⽬名称:tichu-tournament,代码⾏数:26,
⽰例7: sample4a
点赞 3
# 需要导⼊模块: aphics import shapes [as 别名]
# 或者: aphics.shapes import Drawing [as 别名]
def sample4a():
"Sample drawing, xvalue/yvalue axes, y connected at 100 pts to x." drawing = Drawing(400, 200)
data = [(10, 20, 30, 42)]
yAxis = YValueAxis()
yAxis.setPosition(50, 50, 125)
xAxis = XValueAxis()
xAxis._length = 300
xAxis.joinAxis = yAxis
xAxis.joinAxisMode = 'points'
xAxis.joinAxisPos = 100
drawing.add(xAxis)
drawing.add(yAxis)
return drawing
开发者ID:aragos,项⽬名称:tichu-tournament,代码⾏数:18,
⽰例8: sample4b
点赞 3
# 需要导⼊模块: aphics import shapes [as 别名]
# 或者: aphics.shapes import Drawing [as 别名]
def sample4b():
"Sample drawing, xvalue/yvalue axes, y connected at value 35 of x." drawing = Drawing(400, 200)

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。