https://github.com/wyhaya/qrcode-png
Generate QR code in PNG format
https://github.com/wyhaya/qrcode-png
png qrcode qrcode-encoder qrcode-generator
Last synced: 4 days ago
JSON representation
Generate QR code in PNG format
- Host: GitHub
- URL: https://github.com/wyhaya/qrcode-png
- Owner: wyhaya
- Created: 2020-05-25T10:41:22.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-09-07T06:47:26.000Z (over 2 years ago)
- Last Synced: 2025-04-22T21:03:44.957Z (18 days ago)
- Topics: png, qrcode, qrcode-encoder, qrcode-generator
- Language: Rust
- Homepage:
- Size: 18.6 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# qrcode-png
[](https://crates.io/crates/qrcode-png)
[](https://crates.io/crates/qrcode-png)
Generate QR code in png format
## InstallAdd this in your `Cargo.toml`:
```toml
[dependencies]
qrcode-png = "*"
```## Example
```rust
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();
}
```