qrcode = “0.14.1”
image = “0.25.5”
use qrcode::QrCode; use image::Luma; fn main() { let code = QrCode::new(b"https://google.com").unwrap(); let image = code.render::<Luma<u8>>().build(); image.save("./data/qrcode.png").unwrap(); let string = code.render() .light_color(' ') .dark_color('#') .build(); println!("{}", string); }
うーん、なるほど…