RQRCode::Export::PNG
Instance methods
Render the PNG from the QR Code.
Options: fill - Background color ("white" default), hex string или [r,g,b]/[r,g,b,a] color - Foreground color ("black" default), формат тот же
When option :file is supplied the file is written with the given path (color_mode/bit_depth/interlace/compression принимаются, но игнорируются).
There are two sizing algorithms.
- Original that can result in blurry and hard to scan images
- Google's Chart API inspired sizing that resizes the module size to fit within the given image size.
The Googleis one will be used when no options are given or when the new size option is used.
Google size - Total size of PNG in pixels. The module size is calculated so it fits. (defaults to 120) border_modules - Width of white border around in modules. (defaults to 4).
-- DONT USE border_modules OPTION UNLESS YOU KNOW ABOUT THE QUIET ZONE NEEDS OF QR CODES --
Original module_px_size - Image size, in pixels. border - Border thickness, in pixels
It first creates an image where 1px = 1 module, then resizes. Defaults to 120x120 pixels, customizable by option.