Compare commits
2 Commits
2c79551f80
...
bc169183ba
Author | SHA1 | Date | |
---|---|---|---|
bc169183ba | |||
acbc157694 |
@ -464,6 +464,14 @@ export class LabelCommand {
|
||||
this.addStrToCommand(str);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制方框
|
||||
* @param x 方框左上角 X 座标,单位:dot
|
||||
* @param y 方框左上角 Y 座标,单位:dot
|
||||
* @param xend 方框右下角 X 座标,单位:dot
|
||||
* @param yend 方框右下角 X 座标,单位:dot
|
||||
* @param thickness 方框线条粗細,单位:dot
|
||||
*/
|
||||
addBox(
|
||||
x: number,
|
||||
y: number,
|
||||
|
26
src/index.ts
26
src/index.ts
@ -1 +1,27 @@
|
||||
export * from "./command";
|
||||
|
||||
import {
|
||||
FONTMUL,
|
||||
FONTTYPE,
|
||||
LabelCommand,
|
||||
ROTATION,
|
||||
EEC,
|
||||
} from "@/command/Label";
|
||||
|
||||
function main() {
|
||||
let label = new LabelCommand(50, 30, 0);
|
||||
label.addText(
|
||||
0,
|
||||
0,
|
||||
FONTTYPE.FONT_1,
|
||||
ROTATION.ROTATION_0,
|
||||
FONTMUL.MUL_1,
|
||||
FONTMUL.MUL_1,
|
||||
"Hello World"
|
||||
);
|
||||
label.addQRCode(0, 0, EEC.LEVEL_L, 5, ROTATION.ROTATION_0, "taoya.art");
|
||||
var command = label.getCommand();
|
||||
console.log(command); // 获取字节码
|
||||
console.log(label.getCommandStr(command));
|
||||
}
|
||||
main();
|
||||
|
Loading…
Reference in New Issue
Block a user