qrcode-png

Crates.ioqrcode-png
lib.rsqrcode-png
version0.4.1
sourcesrc
created_at2020-05-25 10:52:19.067674
updated_at2022-09-07 06:48:32.558599
descriptionGenerate QR code in png format
homepagehttps://github.com/wyhaya/qrcode-png
repositoryhttps://github.com/wyhaya/qrcode-png.git
max_upload_size
id245527
size11,963
(wyhaya)

documentation

README

qrcode-png

Crates.io LICENSE

Generate QR code in png format

Install

Add this in your Cargo.toml:

[dependencies]
qrcode-png = "*"

Example

use qrcode_png::*;

fn main() {
    let mut qrcode = QrCode::new(b"Hello Rust !", QrCodeEcc::Medium).unwrap();

    qrcode.margin(10);
    qrcode.zoom(10);

    let buf = qrcode.generate(Color::Grayscale(0, 255)).unwrap();
    std::fs::write("./qrcode.png", buf).unwrap();
}

qrcode

Commit count: 19

cargo fmt