提问人:chandana 提问时间:11/14/2023 最后编辑:Mark Setchellchandana 更新时间:11/14/2023 访问量:33
我们可以创建一个自定义类以在 qr.make_image() 方法module_drawer参数中使用它吗?
Can we create a custom class to use it in module_drawer paramter in qr.make_image() method
问:
我需要一个解决方案,将输入作为 svg 文件或 png 文件。基于此,我们需要更改qr码上的模式,让我提供输入和输出以供参考 input:input 将在 png 中,否则 svg Svg 文件 输出:输出带有图案的二维码
使用的模块是python中的qr码
我尝试使用这个自定义的眼睛代码,我将其用于模块抽屉,但没有按预期工作 https://github.com/lincolnloop/python-qrcode/issues/237
import qrcode
from qrcode.image.styledpil import StyledPilImage
qr = qrcode.QRCode(error_correction=qrcode.constants.ERROR_CORRECT_H)
qr.add_data('http://www.medium.com')
qr_inner_eyes_img = qr.make_image(image_factory-StyledPilImage,
Module_drawer=StarModuleDrawer(), color_mask=SolidFillColorMask(back_color=(255, 255, 255), front_color=(63, 42, 86))) qr_inner_eyes_img.save(f"(base_path}/final_image.png")
答: 暂无答案
评论