Description
The QR Code Generator Interface Asset is an "off-the-shelf" component of Intuiface, permitting the encoding of a given string into a QR code that can then be automatically rendered on screen.
The input parameter of this Interface Asset is the text to be encoded. Although typically used to encode URLs, any text string can be processed.
Any Intuiface user can modify the visual representation of the QR Code Generator Interface Asset. This visual representation - specified by a data template - can access and manipulate any of the properties listed later in this article
Note: There are two versions of the QR Code Generator, one for Player 8 and the other for Player Classic. You'll find both these Interface Assets within the Interface Assets Panel in Composer.
QR Code Generator (Player 8 and above)
Properties
These properties are read-only, meaning they are only accessible through binding
- Encoded Text: the text to be encoded as a QR code. Can be, but doesn't have to be, a URL.
- Generated QR code path: text containing the full path to the QR code image - a .png file - on your local filesystem. This value includes the name of the .png file itself, and thus it can be used as the content value for an Image Asset through binding.
Triggers
-
QR code image ready: raised when the QR code image has been generated.
- QR code image path: the path of the generated QR code image
Actions
-
Set Text or URL to encode: generate a QR code based on the provided text or URL.
- Background color: set the background color of the QR code.
- Foreground color: set the foreground color (the dots) of the QR code.
-
Scale factor: set the scale factor of the QR code. A value of
1means 1 pixel will be used to represent each foreground dot. - Width: set the width, in pixels, of the generated QR code.
- Margin: set the pixel width of the quiet margin zone in the generated QR code. Defaults to 4 pixels wide.
-
Error correction level: set the correction level. The lower the level, the more text you can fit, but the less damage the QR code can take before becoming unreadable. Choose from one of four levels:
- L (Low): Can tolerate damage to about 7% of the QR code and still be readable.
- M (Medium): Can tolerate ~15% damage
- Q (Quartile): Can tolerate ~25% damage
- H (High): Can tolerate ~30% damage
- Input text or URL: the input text or url you wish to use to encode the URL.
QR Code Generator (Player Classic)
Properties
- Text to encode, text containing the URL or text to be encoded as a QR code
The property below is a read-only property, thus only visible through a binding
- Generated QR code path, text containing the full path to the QR code image - a .png file - on your local filesystem. This value includes the name of the .png file itself, and thus it can be used as the content value for an Image asset through binding.
Triggers
- QR code image ready: raised when the QR code image has been generated.
Actions
-
Set Text to encode: sets the value of the property "Text to encode"
- Text to encode: the new text to encode as a QR code
Alternative for platforms other than Windows
If you need to generate a QR Code for an experience running on a platform other than Windows, and your deployed experiences will have internet access, use a third-party web service such as http://goqr.me/api/. This third-party service returns a QR Code image in response to a web request. For example, here is the syntax for creating a 150 pixel by 150 pixel QR Code containing the URL "www.intuiface.com":
https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=www.intuiface.com
To adopt such a method:
- If the URL is dynamically generated, use a Text Manipulation Interface Asset or Converter to combine the root URL with dynamic data
- Bind an Image Asset to the output of the text manipulation step. This works because an image can be represented by a URL in the Image Asset.
Video explanation - Creating QR codes
You will find in the Quarterly Q&A Live - Summer Edition 2022 video a detailed example of how to implement QR codes in your experiences.
Comments
0 comments
Article is closed for comments.