# QR code generate

An action block that generates an image of a QR code.

The fiber will pause until the image has been written.

An easy way show a QR code on screen is to save it as SVG then open in with the Dialog web block, confine the Viewport width for proper scaling. Most apps displaying a black & white PNG image will use interpolated scaling that makes it blurry when enlarged, use the Image rescale block to quadruple its size, or more, to make it appear less so.

To scan a QR code use the App decision block with action `"com.google.zxing.client.android.SCAN"` and extras `{"SCAN_MODE":"QR_CODE_MODE"}`, the result will then be in the extras output variable. If no app is capable of handling the action, i.e. an `ActivityNotFoundException` failure, then install the Barcode scanner app.

## Input arguments

- Content — contents of the QR code.
- Error correction — level of error correction, default is Medium.
- Padding — padding/border of the QR code in pixels, default is 1.
- MIME type — type of image file to write, default is an PNG image.
- Destination path — file or directory path where the image file will be written, default is a file in the “DCIM” directory.

## Output variables

- Image file — variable to assign the path to the QR code image file.