From 7d9b11c93e8ef3844cc50621adb307fa67088881 Mon Sep 17 00:00:00 2001 From: James Wah Date: Fri, 2 Jul 2021 17:20:17 +1000 Subject: [PATCH] don't beep haha --- hotprint.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hotprint.py b/hotprint.py index ce3c619..d64a6ab 100755 --- a/hotprint.py +++ b/hotprint.py @@ -40,8 +40,11 @@ def label_to_command(image, labelwidth=810, labelheight=1200): 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]) + + label = Image.new('1', (labelwidth, labelheight)) + label.paste(image, (paste_x, paste_y)) 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