每次我調用 Convert() 或 send() 函數時,Python 代碼都會維護我在列表中打印的徽章。因此,每次我嘗試打印新徽章時,它都會首先打印所有舊徽章。在我執行 Convert() 和 send() 命令進行打印后,任何人都可以看到如何從列表中刪除徽章圖像嗎?這是代碼:import pygameimport timefrom PIL import Imagefrom brother_ql.conversion import convertfrom brother_ql.backends.helpers import sendfrom brother_ql.raster import BrotherQLRasterfrom brother_ql.backends import backend_factory, guess_backend######################################################################################################## Test QR-800 Printer###################################################################################################### Here I just get two images each of size 1044x696image1 = Image.open('RedBlack1_1044x696.png')image2 = Image.open('RedBlack2_1044x696.png')backend = 'linux_kernel'? ? # 'pyusb', 'linux_kernel', 'network'model = 'QL-800' # your printer model.printer = '/dev/usb/lp0'? ??qlr = BrotherQLRaster(model)qlr.exception_on_warning = Truebadge = convert(? ? qlr=qlr,?? ? images=[image1],? ? #? Takes a list of file names or PIL objects.? ? label='62red',?? ? rotate='90',? ? # 'Auto', '0', '90', '270'? ? threshold=70.0,? ? # Black and white threshold in percent.? ? dither=False,?? ? compress=False,?? ? red=True,? ? # Only True if using Red/Black 62 mm label tape.? ? dpi_600=False,?? ? lq=False,? ? # True for low quality.? ? no_cut=False)
1 回答

躍然一笑
TA貢獻1826條經驗 獲得超6個贊
convert 將當前圖像的光柵化指令添加到發送到打印機的數據中??赡?,您需要在第二個之前重置要發送的數據send()
一種方法是qlr = BrotherQLRaster(model)
在第二個之前使用convert()
,但我無法測試這一點來確定,因為我沒有兄弟打印機。
添加回答
舉報
0/150
提交
取消