xlang
v4.0 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
xlibrarys
zxing
zxing.xcs
浏览该文件的文档.
1
//xlang
2
class
ZXing
:
Library
{
3
public
enum
BarcodeFormat {
5
AZTEC
,
6
8
CODABAR
,
9
11
CODE_39
,
12
14
CODE_93
,
15
17
CODE_128
,
18
20
DATA_MATRIX
,
21
23
EAN_8
,
24
26
EAN_13
,
27
29
ITF
,
30
32
MAXICODE
,
33
35
PDF_417
,
36
38
QR_CODE
,
39
41
RSS_14
,
42
44
RSS_EXPANDED
,
45
47
UPC_A
,
48
50
UPC_E
,
51
53
UPC_EAN_EXTENSION
,
54
55
56
57
// Not valid value, used to count the number of formats, thus should be always the last listed here
58
FORMAT_COUNT
59
};
60
61
static
bool
bLoaded
=
new
ZXing
().
load
();
62
63
static
bool
load
() {
64
try
{
65
loadLibrary
(
"ZXingCore"
);
66
return
true
;
67
}
catch
(
Exception
e) {
68
}
69
70
return
false
;
71
}
72
73
import
{
74
Object
cdecl generator_qr(
int
format,
String
content,
int
width,
int
height,
bool
naked,
bool
bpixels);
75
Object
cdecl
read_qrcode
(ObjectPtr buffer,
int
offset,
int
width,
int
height,
int
row_bytes,
int
pixel_bytes,
76
int
index_r,
int
index_g,
int
index_b, ObjectPtr num_bits, ObjectPtr status, ObjectPtr format);
77
};
78
79
public
static
class
Result {
80
String
text
;
81
BarcodeFormat
format
;
82
83
public
Result
(
byte
[] data,
ZXing
.
BarcodeFormat
fmt) {
84
text =
new
String
(data);
85
format = fmt;
86
}
87
public
String
getText
() {
88
return
text;
89
}
90
public
BarcodeFormat
getFormat
() {
91
return
format;
92
}
93
};
94
95
public
static
Result
readQRCodeFromARGB8888Buffer
(
int
[] data,
int
offset,
int
width,
int
height) {
96
int
num_bits = 5, status = 7;
97
ZXing.BarcodeFormat
format =
ZXing
.
BarcodeFormat
.
FORMAT_COUNT
;
98
byte
[] rs = (
byte
[])
ZXing
.
read_qrcode
(data, offset, width, height, width * 4, 4, 1, 2, 3, num_bits, status, format);
99
100
if
(rs != nilptr) {
101
return
new
Result(rs, format);
102
}
103
104
return
nilptr;
105
}
106
107
public
static
byte
[]
generateQRCodeToARGB8888Bitmap
(
String
content,
int
widthOrHeight,
bool
isBmpFile) {
108
return
(
byte
[])generator_qr(
ZXing
.
BarcodeFormat
.
QR_CODE
, content, widthOrHeight, widthOrHeight, !isBmpFile,
false
);
109
}
110
111
public
static
int
[]
generateQRCodeToARGB8888Pixels
(
String
content,
int
widthOrHeight,
bool
isBmpFile) {
112
return
(
int
[])generator_qr(
ZXing
.
BarcodeFormat
.
QR_CODE
, content, widthOrHeight, widthOrHeight, !isBmpFile,
true
);
113
}
114
};
115
116
/*
117
int main(String [] args){
118
byte [] data = ZXing.generateQRCodeToARGB8888Bitmap("1566", 100, true);
119
long hf = _system_.openFile("ll.bmp","w");
120
_system_.writeFile(hf,data,0,data.length);
121
_system_.closeFile(hf);
122
return 0;
123
}*/
Exception
异常类
Definition
BuiltinObjects.x:158
Library
Definition
BuiltinObjects.x:1226
Library.loadLibrary
static final void loadLibrary(String)
Object
Definition
BuiltinObjects.x:14
String
字符串类
Definition
BuiltinObjects.x:65
ZXing.Result.Result
Result(byte [] data, ZXing.BarcodeFormat fmt)
Definition
zxing.xcs:83
ZXing.Result.getFormat
BarcodeFormat getFormat()
Definition
zxing.xcs:90
ZXing.Result.getText
String getText()
Definition
zxing.xcs:87
ZXing.Result.text
String text
Definition
zxing.xcs:80
ZXing.Result.format
BarcodeFormat format
Definition
zxing.xcs:81
ZXing
Definition
zxing.xcs:2
ZXing.generateQRCodeToARGB8888Pixels
static int [] generateQRCodeToARGB8888Pixels(String content, int widthOrHeight, bool isBmpFile)
Definition
zxing.xcs:111
ZXing.generateQRCodeToARGB8888Bitmap
static byte [] generateQRCodeToARGB8888Bitmap(String content, int widthOrHeight, bool isBmpFile)
Definition
zxing.xcs:107
ZXing.bLoaded
static bool bLoaded
Definition
zxing.xcs:61
ZXing.readQRCodeFromARGB8888Buffer
static Result readQRCodeFromARGB8888Buffer(int[] data, int offset, int width, int height)
Definition
zxing.xcs:95
ZXing.load
static bool load()
Definition
zxing.xcs:63
ZXing.read_qrcode
Object cdecl read_qrcode(ObjectPtr buffer, int offset, int width, int height, int row_bytes, int pixel_bytes, int index_r, int index_g, int index_b, ObjectPtr num_bits, ObjectPtr status, ObjectPtr format)
ZXing.BarcodeFormat
Definition
zxing.xcs:3
ZXing.BarcodeFormat.DATA_MATRIX
DATA_MATRIX
Definition
zxing.xcs:20
ZXing.BarcodeFormat.CODE_93
CODE_93
Definition
zxing.xcs:14
ZXing.BarcodeFormat.FORMAT_COUNT
FORMAT_COUNT
Definition
zxing.xcs:58
ZXing.BarcodeFormat.ITF
ITF
Definition
zxing.xcs:29
ZXing.BarcodeFormat.QR_CODE
QR_CODE
Definition
zxing.xcs:38
ZXing.BarcodeFormat.MAXICODE
MAXICODE
Definition
zxing.xcs:32
ZXing.BarcodeFormat.UPC_E
UPC_E
Definition
zxing.xcs:50
ZXing.BarcodeFormat.AZTEC
AZTEC
Definition
zxing.xcs:5
ZXing.BarcodeFormat.EAN_8
EAN_8
Definition
zxing.xcs:23
ZXing.BarcodeFormat.UPC_EAN_EXTENSION
UPC_EAN_EXTENSION
Definition
zxing.xcs:53
ZXing.BarcodeFormat.CODE_128
CODE_128
Definition
zxing.xcs:17
ZXing.BarcodeFormat.CODABAR
CODABAR
Definition
zxing.xcs:8
ZXing.BarcodeFormat.UPC_A
UPC_A
Definition
zxing.xcs:47
ZXing.BarcodeFormat.CODE_39
CODE_39
Definition
zxing.xcs:11
ZXing.BarcodeFormat.RSS_14
RSS_14
Definition
zxing.xcs:41
ZXing.BarcodeFormat.RSS_EXPANDED
RSS_EXPANDED
Definition
zxing.xcs:44
ZXing.BarcodeFormat.EAN_13
EAN_13
Definition
zxing.xcs:26
ZXing.BarcodeFormat.PDF_417
PDF_417
Definition
zxing.xcs:35
制作者
1.9.8