qrcode png
v0.4.1
以PNG格式生成QR碼
將其添加到您的Cargo.toml
中:
[依賴項] qrcode-png =“*”
使用qrcode_png ::*; fn main(){讓mut qrcode = qrcode :: new(b“ hello rust!”,qrcodeecc :: medive).unwrap().unwrap(); qrcode.margin(10); qrcode. zoom(10) ; ling buf = qrcode.generate(color :: grayscale(0,255))。unwrap(); std :: fs :: write(“ ./ qrcode.png”,buf),buf).unwrap ();