b = Barcode.createQRCode(image_filename, qr_code_text,
ʃerrorCorrection := ecc,ʅ
ʃscale := scale,ʅ
ʃquietZone := quiet_zone,ʅ
ʃdarkColor := dark_color,ʅ
ʃlightColor := light_colorʅ);
The
Barcode.createQRCode function creates a
QR code and saves the image of the QR code to a file specified by the string expression
image_filename. The text for the QR code,
qr_code_text, can be specified using a string or numeric expression.
- errorCorrection := error correction level, specified as a string expression evaluating to one of four levels: "low" ‖ "medium" ‖ "quartile" ‖ "high". The higher the level, the larger the dimensions of QR code, as well as the increased likelihood that a partially corrupted QR code can be read. In addition to the words, the level can be specified using single letters: "L" ‖ "M" ‖ "Q" ‖ "H". (Default setting: medium.)
- scale := the number of pixels per "module," specified as a numeric expression. The value cannot be less than 1, and the higher the value, the larger the dimensions of the QR code. (Default setting: 4.)
- quietZone := the "quiet zone" (margin) around the QR code, specified as a numeric expression in "modules." The value cannot be less than 4. (Default setting: 4. Using the default scale and quiet zone results in a margin of 4 x 4 = 16 pixels.)
- darkColor := the color of the dark areas, specified as a string expression evaluating to a HTML color name (like "red") or a hex color code (like "#ff0000"). (Default: black.)
- lightColor := the color of the light areas, specified as a string expression. (Default: white.)
The dimensions of the created QR code image are not known prior to creation as they depend in part on the length of the input text, as well as the error correction level.
The function returns a logical value of 1 (
true) if the QR code was successfully generated and the image was saved, or 0 (
false) on error.
Barcode.createQRCode("Google-Play-CSEntry-url.jpg",
"https://play.google.com/store/apps/details?id=gov.census.cspro.csentry",
errorCorrection := "quartile",
scale := 6,
quietZone := 8,
darkColor := "white",
lightColor := "green");