qrcode-rust/examples/encode_image.rs
2019-12-22 17:34:09 +08:00

14 lines
295 B
Rust

use image::Luma;
use qrcode::QrCode;
fn main() {
// Encode some data into bits.
let code = QrCode::new(b"01234567").unwrap();
// Render the bits into an image.
let image = code.render::<Luma<u8>>().build();
// Save the image.
image.save("/tmp/qrcode.png").unwrap();
}