don't beep haha
This commit is contained in:
parent
2f590a8560
commit
7d9b11c93e
1 changed files with 4 additions and 1 deletions
|
@ -40,8 +40,11 @@ def label_to_command(image, labelwidth=810, labelheight=1200):
|
||||||
row_bytes = (im.size[0] + 7) // 8
|
row_bytes = (im.size[0] + 7) // 8
|
||||||
|
|
||||||
command = b"CLS\r\nBITMAP %d,%d,%d,%d,0," % (paste_x, paste_y, row_bytes, im.size[1])
|
command = b"CLS\r\nBITMAP %d,%d,%d,%d,0," % (paste_x, paste_y, row_bytes, im.size[1])
|
||||||
|
|
||||||
|
label = Image.new('1', (labelwidth, labelheight))
|
||||||
|
label.paste(image, (paste_x, paste_y))
|
||||||
command += image.tobytes()
|
command += image.tobytes()
|
||||||
command += b"\r\nPRINT 1,1\r\nSOUND 3,200\r\n"
|
command += b"\r\nPRINT 1,1\r\n"
|
||||||
return command
|
return command
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue