「App:Library:LVGL:docs:3rd party libraries:QR code」の版間の差分
提供: robot-jp wiki
ナビゲーションに移動検索に移動(同じ利用者による、間の5版が非表示) | |||
1行目: | 1行目: | ||
https://docs.lvgl.io/8.2/libs/qrcode.html | https://docs.lvgl.io/8.2/libs/qrcode.html | ||
__NOTOC__ | __NOTOC__ | ||
+ | = QR code = | ||
{| class="wikitable" | {| class="wikitable" | ||
!英文 | !英文 | ||
6行目: | 7行目: | ||
|- | |- | ||
| | | | ||
− | | | + | QR code generation with LVGL. Uses QR-Code-generator by nayuki. |
+ | |LVGLによるQRコードの生成。nayukiによるQRコードジェネレーターを使用しています。 | ||
|} | |} | ||
+ | :[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]] | ||
− | |||
− | |||
− | |||
− | |||
== Get started == | == Get started == | ||
− | + | {| class="wikitable" | |
+ | !英文 | ||
+ | !自動翻訳 | ||
+ | |- | ||
+ | | | ||
* Download or clone this repository | * Download or clone this repository | ||
** Download from GitHub | ** Download from GitHub | ||
** Clone: git clone <nowiki>https://github.com/lvgl/lv_lib_qrcode.git</nowiki> | ** Clone: git clone <nowiki>https://github.com/lvgl/lv_lib_qrcode.git</nowiki> | ||
− | * Include the library: <code>#include "lv_lib_qrcode/lv_qrcode.h"</code> | + | * Include the library: <code style="color: #bb0000;">#include "lv_lib_qrcode/lv_qrcode.h"</code> |
* Test with the following code: | * Test with the following code: | ||
− | + | <syntaxhighlight lang="C++" style="border:1px dashed gray;"> | |
const char * data = "Hello world"; | const char * data = "Hello world"; | ||
29行目: | 32行目: | ||
/*Set data*/ | /*Set data*/ | ||
lv_qrcode_update(qr, data, strlen(data)); | lv_qrcode_update(qr, data, strlen(data)); | ||
+ | </syntaxhighlight> | ||
+ | | | ||
+ | * このリポジトリをダウンロードまたは複製します | ||
+ | ** GitHubからダウンロード | ||
+ | ** クローン:git clone <nowiki>https://github.com/lvgl/lv_lib_qrcode.git</nowiki> | ||
+ | * ライブラリを含める:<code style="color: #bb0000;">#include "lv_lib_qrcode/lv_qrcode.h"</code> | ||
+ | * 次のコードでテストします。 | ||
+ | <syntaxhighlight lang="C++" style="border:1px dashed gray;"> | ||
+ | const char * data = "Hello world"; | ||
+ | |||
+ | / *100x100QRコードを作成します*/ | ||
+ | lv_obj_t * qr = lv_qrcode_create(lv_scr_act()、100、lv_color_hex3(0x33f)、lv_color_hex3(0xeef)); | ||
+ | |||
+ | /*データを設定*/ | ||
+ | lv_qrcode_update(qr、data、strlen(data)); | ||
+ | </syntaxhighlight> | ||
+ | |} | ||
+ | :[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]] | ||
+ | |||
== Notes == | == Notes == | ||
+ | {| class="wikitable" | ||
+ | !英文 | ||
+ | !自動翻訳 | ||
+ | |- | ||
+ | | | ||
+ | * QR codes with less data are smaller, but they scaled by an integer number to best fit to the given size. | ||
+ | | | ||
+ | * データ量の少ないQRコードは小さくなりますが、与えられたサイズに最適になるように整数倍でスケーリングされます。 | ||
+ | |} | ||
+ | :[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]] | ||
− | |||
== Example == | == Example == | ||
+ | {| class="wikitable" | ||
+ | !英文 | ||
+ | !自動翻訳 | ||
+ | |- | ||
+ | | | ||
=== Create a QR Code === | === Create a QR Code === | ||
[[file:LVGL docs 3rdPartyLibs QRcode 01.png|link=https://docs.lvgl.io/8.2/libs/qrcode.html#create-a-qr-code]] | [[file:LVGL docs 3rdPartyLibs QRcode 01.png|link=https://docs.lvgl.io/8.2/libs/qrcode.html#create-a-qr-code]] | ||
+ | | | ||
+ | |} | ||
+ | :[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]] | ||
− | |||
== API == | == API == | ||
+ | {| class="wikitable" | ||
+ | !英文 | ||
+ | !自動翻訳 | ||
+ | |- | ||
+ | | | ||
Functions | Functions | ||
− | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_obj_t *lv_qrcode_create(lv_obj_t *parent, lv_coord_t size, lv_color_t dark_color, lv_color_t light_color) </span> | |
− | : Create an empty QR code (an <code>lv_canvas</code>) object. | + | : Create an empty QR code (an <code style="color: #bb0000;">lv_canvas</code>) object. |
:; Parameters | :; Parameters | ||
− | ::* parent -- point to an object where to | + | ::* parent -- point to an object where to create the QR code |
::* size -- width and height of the QR code | ::* size -- width and height of the QR code | ||
::* dark_color -- dark color of the QR code | ::* dark_color -- dark color of the QR code | ||
53行目: | 96行目: | ||
:: pointer to the created QR code object | :: pointer to the created QR code object | ||
− | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_res_t lv_qrcode_update(lv_obj_t *qrcode, const void *data, uint32_t data_len) </span> | |
: Set the data of a QR code object | : Set the data of a QR code object | ||
:; Parameters | :; Parameters | ||
− | ::* qrcode -- pointer to aQ | + | ::* qrcode -- pointer to aQ code object |
::* data -- data to display | ::* data -- data to display | ||
::* data_len -- length of data in bytes | ::* data_len -- length of data in bytes | ||
62行目: | 105行目: | ||
:: LV_RES_OK: if no error; LV_RES_INV: on error | :: LV_RES_OK: if no error; LV_RES_INV: on error | ||
− | + | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_qrcode_delete(lv_obj_t *qrcode) </span> | |
− | : DEPRECATED: Use normal lv_obj_del | + | : DEPRECATED: Use normal lv_obj_del instead Delete a QR code object |
:; Parameters | :; Parameters | ||
:: qrcode -- pointer to a QR code object | :: qrcode -- pointer to a QR code object | ||
69行目: | 112行目: | ||
Variables | Variables | ||
− | + | const lv_obj_class_t lv_qrcode_class | |
+ | | | ||
+ | 機能 | ||
+ | <span style="background-color:#e7f2fa;color:#2980b9;">lv_obj_t * lv_qrcode_create(lv_obj_t * parent、lv_coord_t size、lv_color_t dark_color、lv_color_t light_color)</span> | ||
+ | : 空のQRコード(<code style="color: #bb0000;">lv_canvas</code>)オブジェクトを作成します。 | ||
+ | :; パラメーター | ||
+ | ::* 親-QRコードを作成するオブジェクトをポイントします | ||
+ | ::* サイズ-QRコードの幅と高さ | ||
+ | ::* dark_color-QRコードの暗い色 | ||
+ | ::* light_color-QRコードの明るい色 | ||
+ | :; 戻り値 | ||
+ | :: 作成したQRコードオブジェクトへのポインタ | ||
+ | <span style="background-color:#e7f2fa;color:#2980b9;">lv_res_t lv_qrcode_update(lv_obj_t * qrcode、const void * data、uint32_t data_len)</span> | ||
+ | : QRコードオブジェクトのデータを設定する | ||
+ | :; パラメーター | ||
+ | ::* qrcode-aQコードオブジェクトへのポインタ | ||
+ | ::* data-表示するデータ | ||
+ | ::* data_len-バイト単位のデータの長さ | ||
+ | :; 戻り値 | ||
+ | :: LV_RES_OK:エラーがない場合。LV_RES_INV:エラー時 | ||
+ | |||
+ | <span style="background-color:#e7f2fa;color:#2980b9;">void lv_qrcode_delete(lv_obj_t * qrcode)</span> | ||
+ | : 非推奨:代わりに通常のlv_obj_delを使用してくださいQRコードオブジェクトを削除してください | ||
+ | :; パラメーター | ||
+ | :: qrcode-QRコードオブジェクトへのポインタ | ||
+ | |||
+ | 変数 | ||
+ | |||
+ | const lv_obj_class_t lv_qrcode_class | ||
+ | |} | ||
− | |||
:[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]] | :[[App:Library:LVGL:docs:3rd party libraries|戻る : Previous]] |
2022年6月29日 (水) 17:09時点における最新版
https://docs.lvgl.io/8.2/libs/qrcode.html
QR code
英文 | 自動翻訳 |
---|---|
QR code generation with LVGL. Uses QR-Code-generator by nayuki. |
LVGLによるQRコードの生成。nayukiによるQRコードジェネレーターを使用しています。 |
Get started
英文 | 自動翻訳 |
---|---|
const char * data = "Hello world";
/*Create a 100x100 QR code*/
lv_obj_t * qr = lv_qrcode_create(lv_scr_act(), 100, lv_color_hex3(0x33f), lv_color_hex3(0xeef));
/*Set data*/
lv_qrcode_update(qr, data, strlen(data));
|
const char * data = "Hello world";
/ *100x100QRコードを作成します*/
lv_obj_t * qr = lv_qrcode_create(lv_scr_act()、100、lv_color_hex3(0x33f)、lv_color_hex3(0xeef));
/*データを設定*/
lv_qrcode_update(qr、data、strlen(data));
|
Notes
英文 | 自動翻訳 |
---|---|
|
|
Example
英文 | 自動翻訳 |
---|---|
Create a QR Code |
API
英文 | 自動翻訳 |
---|---|
Functions lv_obj_t *lv_qrcode_create(lv_obj_t *parent, lv_coord_t size, lv_color_t dark_color, lv_color_t light_color)
lv_res_t lv_qrcode_update(lv_obj_t *qrcode, const void *data, uint32_t data_len)
void lv_qrcode_delete(lv_obj_t *qrcode)
Variables const lv_obj_class_t lv_qrcode_class |
lv_obj_t * lv_qrcode_create(lv_obj_t * parent、lv_coord_t size、lv_color_t dark_color、lv_color_t light_color)
lv_res_t lv_qrcode_update(lv_obj_t * qrcode、const void * data、uint32_t data_len)
void lv_qrcode_delete(lv_obj_t * qrcode)
変数 const lv_obj_class_t lv_qrcode_class |