|
|
|
@ -43,6 +43,7 @@ Examples
|
|
|
|
|
|
|
|
|
|
Java language:
|
|
|
|
|
|
|
|
|
|
```java
|
|
|
|
|
import java.awt.image.BufferedImage;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.util.List;
|
|
|
|
@ -62,9 +63,11 @@ Java language:
|
|
|
|
|
(... paint qr1.getModule(x, y) ...)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
TypeScript/JavaScript languages:
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
// Name abbreviated for the sake of these examples here
|
|
|
|
|
var QRC = qrcodegen.QrCode;
|
|
|
|
|
|
|
|
|
@ -80,9 +83,11 @@ TypeScript/JavaScript languages:
|
|
|
|
|
(... paint qr1.getModule(x, y) ...)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Python language:
|
|
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
from qrcodegen import *
|
|
|
|
|
|
|
|
|
|
# Simple operation
|
|
|
|
@ -95,9 +100,11 @@ Python language:
|
|
|
|
|
for y in range(qr1.get_size()):
|
|
|
|
|
for x in range(qr1.get_size()):
|
|
|
|
|
(... paint qr1.get_module(x, y) ...)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
C++ language:
|
|
|
|
|
|
|
|
|
|
```cpp
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include "QrCode.hpp"
|
|
|
|
@ -117,9 +124,11 @@ C++ language:
|
|
|
|
|
(... paint qr1.getModule(x, y) ...)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
C language:
|
|
|
|
|
|
|
|
|
|
```c
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
#include "qrcodegen.h"
|
|
|
|
@ -147,9 +156,11 @@ C language:
|
|
|
|
|
uint8_t qr1[qrcodegen_BUFFER_LEN_FOR_VERSION(7)];
|
|
|
|
|
ok = qrcodegen_encodeBinary(dataAndTemp, 3, qr1,
|
|
|
|
|
qrcodegen_Ecc_HIGH, 2, 7, qrcodegen_Mask_4, false);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Rust language:
|
|
|
|
|
|
|
|
|
|
```rust
|
|
|
|
|
extern crate qrcodegen;
|
|
|
|
|
use qrcodegen::QrCode;
|
|
|
|
|
use qrcodegen::QrCodeEcc;
|
|
|
|
@ -170,6 +181,7 @@ Rust language:
|
|
|
|
|
(... paint qr.get_module(x, y) ...)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
License
|
|
|
|
|