表示 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 |
此類別(class) 文件是由下列檔案中產生:
- /Users/bob_huang/Documents/Project/UniPRTSDK_python/LabelMaker/TSPL/Shapes.py