Skip to content

Commit

Permalink
chore(readme): add png rendering details
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Nov 19, 2020
1 parent 3c11703 commit dddfa39
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ end
```


### Rendering an SVG
### Rendering a SVG

```crystal
require "qr-code"
Expand All @@ -62,6 +62,19 @@ svg_string = QRCode.new("my string to generate").as_svg
```


### Rendering a PNG

you'll need to add [stumpy_png](https://github.com/stumpycr/stumpy_png) to your `shard.yml` dependencies

```crystal
require "qr-code"
require "qr-code/export/png"
# size == width, and QR codes are square
png_bytes = QRCode.new("my string to generate").as_png(size: 256)
```


## Credits

Based off the ruby gem: https://github.com/whomwah/rqrcode_core
Expand Down

0 comments on commit dddfa39

Please sign in to comment.