表示 TSPL 方框形状的类。
更多...
表示 TSPL 方框形状的类。
该类实现了 IBox 协议,并提供了在 TSPL 中初始化和描述方框的功能。
◆ __init__()
| LabelMaker.TSPL.Shapes.Box.__init__ |
( |
| self, |
|
|
IPoint | start, |
|
|
IPoint | end, |
|
|
float | line_thickness ) |
使用指定的起点和终点及线条厚度初始化 Box 类的新实例。
- 参数
-
| start | 方框的起点。 |
| end | 方框的终点。 |
| line_thickness | 方框线条的厚度。 |
- 返回
- Box 的新实例。
◆ __str__()
| LabelMaker.TSPL.Shapes.Box.__str__ |
( |
| self | ) |
|
返回可以发送到打印机的字符串。
此方法生成 Box 实例的字符串表示形式,格式化并准备好发送到打印机。字符串包括在 TSPL 中打印所需的所有命令和数据。
- 返回
- Box 实例的字符串描述。
◆ from_coordinates()
| LabelMaker.TSPL.Shapes.Box.from_coordinates |
( |
| cls, |
|
|
float | x_start, |
|
|
float | y_start, |
|
|
float | x_end, |
|
|
float | y_end, |
|
|
float | line_thickness = 1.0 ) |
使用指定的起点和终点坐标及线条厚度初始化 Box 类的新实例。
- 参数
-
| x_start | 起点的 x 坐标。 |
| y_start | 起点的 y 坐标。 |
| x_end | 终点的 x 坐标。 |
| y_end | 终点的 y 坐标。 |
| line_thickness | 方框线条的厚度。 |
- 返回
- Box 的新实例。
◆ corner_rounding
| float LabelMaker.TSPL.Shapes.Box.corner_rounding = 0.0 |
◆ end
| LabelMaker.TSPL.Shapes.Box.end = end |
◆ line_thickness
| LabelMaker.TSPL.Shapes.Box.line_thickness = line_thickness |
◆ start
| LabelMaker.TSPL.Shapes.Box.start = start |
该类的文档由以下文件生成:
- /Users/bob_huang/Documents/Project/UniPRTSDK_python/LabelMaker/TSPL/Shapes.py