Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 2 months 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 (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-07T06:47:26.000Z (over 2 years ago)
- Last Synced: 2024-10-28T22:38:17.324Z (3 months ago)
- Topics: png, qrcode, qrcode-encoder, qrcode-generator
- Language: Rust
- Homepage:
- Size: 18.6 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# qrcode-png
[![Crates.io](https://img.shields.io/crates/v/qrcode-png.svg?style=flat-square)](https://crates.io/crates/qrcode-png)
[![LICENSE](https://img.shields.io/crates/l/qrcode-png.svg?style=flat-square)](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();
}
```![qrcode](https://user-images.githubusercontent.com/23690145/83348739-c4f88d00-a361-11ea-932e-e722e0bd1b65.png)