iv-npm 1.7.68 → 1.7.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/ui/dist/Altimeter/index.html +653 -608
- package/packages/ui/dist/index.cjs.js +5 -5
- package/packages/ui/dist/index.cjs.js.map +1 -1
- package/packages/ui/dist/index.esm.js +5 -5
- package/packages/ui/dist/index.esm.js.map +1 -1
- package/packages/ui/dist/index.umd.js +5 -5
- package/packages/ui/dist/index.umd.js.map +1 -1
|
@@ -1,694 +1,739 @@
|
|
|
1
|
-
<!DOCTYPE html
|
|
2
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
2
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<script src="
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
3
|
+
<head>
|
|
4
|
+
<title>文豆高拍仪多浏览器V1.26.2版测试Demo</title>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
</head>
|
|
7
|
+
|
|
8
|
+
<!-- 引入高拍仪JS接口-->
|
|
9
|
+
<script src="wdgpy.js" type="text/javascript" charset="utf-8"></script>
|
|
10
|
+
<script src="postMessage.js" type="text/javascript" charset="utf-8"></script>
|
|
11
|
+
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
function getMessageId(length, chars) {
|
|
14
|
+
var result = "";
|
|
15
|
+
for (var i = length; i > 0; --i)
|
|
16
|
+
result += chars[Math.floor(Math.random() * chars.length)];
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
var messageId = getMessageId(
|
|
20
|
+
10,
|
|
21
|
+
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
var fileBase64Str = "";
|
|
25
|
+
var file_path = "";
|
|
26
|
+
|
|
27
|
+
//时间格式化显示
|
|
28
|
+
function formatDate(time) {
|
|
29
|
+
var date = new Date(time);
|
|
30
|
+
var year = date.getFullYear(),
|
|
31
|
+
month = date.getMonth() + 1,
|
|
32
|
+
day = date.getDate(),
|
|
33
|
+
hour = date.getHours(),
|
|
34
|
+
min = date.getMinutes(),
|
|
35
|
+
sec = date.getSeconds();
|
|
36
|
+
var newTime =
|
|
37
|
+
year +
|
|
38
|
+
(month < 10 ? "0" + month : month) +
|
|
39
|
+
(day < 10 ? "0" + day : day) +
|
|
40
|
+
(hour < 10 ? "0" + hour : hour) +
|
|
41
|
+
(min < 10 ? "0" + min : min) +
|
|
42
|
+
(sec < 10 ? "0" + sec : sec);
|
|
43
|
+
return newTime;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function sleep(milliSeconds) {
|
|
47
|
+
var startTime = new Date().getTime();
|
|
48
|
+
while (new Date().getTime() < startTime + milliSeconds);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function ShowInfo(op) {
|
|
52
|
+
console.log(op);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/*----------------------------------------------------
|
|
48
56
|
---(必须重写该函数)返回获取的设备数目及设备名称 ---
|
|
49
57
|
-----------------------------------------------------*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
obj.
|
|
58
|
+
function GetDevCountAndNameResultCB(devCount, devNameArr) {
|
|
59
|
+
if (devCount > 0) {
|
|
60
|
+
var obj = document.getElementById("DevName");
|
|
61
|
+
obj.options.length = 0;
|
|
62
|
+
for (var i = 0; i < devCount; i++) {
|
|
63
|
+
var objOption = document.createElement("option");
|
|
64
|
+
objOption.text = devNameArr[i];
|
|
65
|
+
objOption.value = i;
|
|
66
|
+
obj.options.add(objOption);
|
|
67
|
+
}
|
|
68
|
+
obj.selectedIndex = 0;
|
|
69
|
+
var CamID = obj.selectedIndex;
|
|
70
|
+
|
|
71
|
+
//获取分辨率
|
|
72
|
+
Cam_GetDevResolution(CamID);
|
|
73
|
+
} else {
|
|
74
|
+
window.parent.postMessage(
|
|
75
|
+
{ error: "没有发现合适的设备!", messageId: messageId },
|
|
76
|
+
"*"
|
|
77
|
+
);
|
|
61
78
|
}
|
|
62
|
-
obj.selectedIndex = 0;
|
|
63
|
-
var CamID = obj.selectedIndex;
|
|
64
|
-
|
|
65
|
-
//获取分辨率
|
|
66
|
-
Cam_GetDevResolution(CamID);
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
window.parent.postMessage({ error: "没有发现合适的设备!" }, '*')
|
|
71
79
|
}
|
|
72
|
-
}
|
|
73
80
|
|
|
74
|
-
|
|
81
|
+
/*---------------------------------------------------
|
|
75
82
|
--- (必须重写该函数)返回获取的设备分辨率信息 ---
|
|
76
83
|
----------------------------------------------------*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
function GetResolutionResultCB(resCount, resArr) {
|
|
85
|
+
if (resCount > 0) {
|
|
86
|
+
var selectIndex = 0;
|
|
87
|
+
var obj = document.getElementById("DevResolution");
|
|
88
|
+
obj.options.length = 0;
|
|
89
|
+
for (var i = 0; i < resCount; i++) {
|
|
90
|
+
var objOption = document.createElement("option");
|
|
91
|
+
objOption.text = resArr[i];
|
|
92
|
+
objOption.value = i;
|
|
93
|
+
obj.options.add(objOption);
|
|
94
|
+
//默认1000万分辨率打开
|
|
95
|
+
if (resArr[i] == "3672*2856") {
|
|
96
|
+
selectIndex = i;
|
|
97
|
+
}
|
|
91
98
|
}
|
|
99
|
+
obj.selectedIndex = selectIndex;
|
|
100
|
+
|
|
101
|
+
//打开摄像头
|
|
102
|
+
Cam_Close();
|
|
103
|
+
var restr = obj[obj.selectedIndex].text;
|
|
104
|
+
var pos = restr.lastIndexOf("*");
|
|
105
|
+
var width = parseInt(restr.substring(0, pos));
|
|
106
|
+
var height = parseInt(restr.substring(pos + 1, restr.length));
|
|
107
|
+
var CamID = document.getElementById("DevName").selectedIndex;
|
|
108
|
+
Cam_Open(CamID, width, height);
|
|
109
|
+
} else {
|
|
110
|
+
window.parent.postMessage({ error: "获取分辨率信息失败!" , messageId: messageId}, "*");
|
|
92
111
|
}
|
|
93
|
-
obj.selectedIndex = selectIndex;
|
|
94
|
-
|
|
95
|
-
//打开摄像头
|
|
96
|
-
Cam_Close();
|
|
97
|
-
var restr = obj[obj.selectedIndex].text;
|
|
98
|
-
var pos = restr.lastIndexOf("*");
|
|
99
|
-
var width = parseInt(restr.substring(0, pos));
|
|
100
|
-
var height = parseInt(restr.substring(pos + 1, restr.length));
|
|
101
|
-
var CamID = document.getElementById("DevName").selectedIndex;
|
|
102
|
-
Cam_Open(CamID, width, height);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
window.parent.postMessage({ error: "获取分辨率信息失败!" }, '*')
|
|
106
112
|
}
|
|
107
|
-
}
|
|
108
113
|
|
|
109
|
-
|
|
110
|
-
/*---------------------------------------------------
|
|
114
|
+
/*---------------------------------------------------
|
|
111
115
|
--- (必须重写该函数)返回摄像头开启状态 ---
|
|
112
116
|
----------------------------------------------------*/
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
function GetCameraOnOffStatus(status) {
|
|
118
|
+
if (status == 0) {
|
|
119
|
+
window.parent.postMessage({ message: "设备开启成功", messageId: messageId }, "*");
|
|
120
|
+
Cam_SetCutMode(1); //设备开启后自动裁剪
|
|
121
|
+
} else {
|
|
122
|
+
window.parent.postMessage({ error: "设备开启失败", messageId: messageId }, "*");
|
|
123
|
+
}
|
|
120
124
|
}
|
|
121
125
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
/*---------------------------------------------------
|
|
126
|
+
/*---------------------------------------------------
|
|
126
127
|
-------- (必须重写该函数)拍照结果 ---------
|
|
127
128
|
----------------------------------------------------*/
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
function GetCaptrueImgResultCB(flag, path, base64Str) {
|
|
130
|
+
if (flag == 0) {
|
|
131
|
+
file_path = path;
|
|
132
|
+
fileBase64Str = base64Str;
|
|
133
|
+
var obj = document.getElementById("CameraPhoto");
|
|
134
|
+
obj.src = "data:;base64," + base64Str;
|
|
135
|
+
if (path == "") {
|
|
136
|
+
window.parent.postMessage({ message: "拍照成功", messageId: messageId }, "*");
|
|
137
|
+
} else {
|
|
138
|
+
window.parent.postMessage(
|
|
139
|
+
{
|
|
140
|
+
message: "拍照成功,图片保存位置:" + path,
|
|
141
|
+
GetCaptrueImgResultCB: "data:;base64," + base64Str,
|
|
142
|
+
messageId: messageId
|
|
143
|
+
},
|
|
144
|
+
"*"
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
window.parent.postMessage({ error: "拍照失败", messageId: messageId }, "*");
|
|
139
149
|
}
|
|
140
150
|
}
|
|
141
|
-
else {
|
|
142
|
-
window.parent.postMessage({ error: "拍照失败" }, '*')
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
|
|
147
151
|
|
|
148
|
-
|
|
152
|
+
/*---------------------------------------------------
|
|
149
153
|
------ (必须重写该函数)身份证信息返回结果 ------
|
|
150
154
|
----------------------------------------------------*/
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
155
|
+
function GetIdCardInfoResultCB(
|
|
156
|
+
flag,
|
|
157
|
+
Name,
|
|
158
|
+
Sex,
|
|
159
|
+
Nation,
|
|
160
|
+
Born,
|
|
161
|
+
Address,
|
|
162
|
+
CardNum,
|
|
163
|
+
IssuedAt,
|
|
164
|
+
EffectedDate,
|
|
165
|
+
CardImgPath,
|
|
166
|
+
CardImgBase64
|
|
167
|
+
) {
|
|
168
|
+
if (flag == 0) {
|
|
169
|
+
document.getElementById("CardName").value = Name;
|
|
170
|
+
document.getElementById("CardSex").value = Sex;
|
|
171
|
+
document.getElementById("CardNation").value = Nation;
|
|
172
|
+
document.getElementById("CardBorn").value = Born;
|
|
173
|
+
document.getElementById("CardAddress").value = Address;
|
|
174
|
+
document.getElementById("CardNum").value = CardNum;
|
|
175
|
+
document.getElementById("CardIssuedAt").value = IssuedAt;
|
|
176
|
+
document.getElementById("CardEffectDate").value = EffectedDate;
|
|
177
|
+
var obj = document.getElementById("IdCardPhoto");
|
|
178
|
+
obj.src = "data:;base64," + CardImgBase64;
|
|
179
|
+
window.parent.postMessage({ message: "读卡成功", messageId: messageId }, "*");
|
|
180
|
+
} else {
|
|
181
|
+
window.parent.postMessage({ error: "读卡失败" , messageId: messageId}, "*");
|
|
182
|
+
}
|
|
167
183
|
}
|
|
168
184
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
/*---------------------------------------------------
|
|
185
|
+
/*---------------------------------------------------
|
|
173
186
|
------ (必须重写该函数)条码二维码识别返回结果------
|
|
174
187
|
----------------------------------------------------*/
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
/*********************
|
|
185
|
-
*** 初始化操作 ***
|
|
186
|
-
**********************/
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
function LoadCameraDocument() {
|
|
190
|
-
|
|
191
|
-
if (!window.WebSocket) {
|
|
192
|
-
alert("浏览器不支持HTML5,请更新或者使用其它浏览器!");
|
|
188
|
+
function QrBarCodeRecogResultCB(flag, codeStr) {
|
|
189
|
+
if (flag == 0)
|
|
190
|
+
window.parent.postMessage(
|
|
191
|
+
{ message: "条码/二维码识别结果:" + codeStr, messageId: messageId },
|
|
192
|
+
"*"
|
|
193
|
+
);
|
|
194
|
+
else window.parent.postMessage({ error: "未识别到内容", messageId: messageId }, "*");
|
|
193
195
|
}
|
|
194
|
-
//console.log("LoadCameraDocument");
|
|
195
|
-
var obj = document.getElementById("CameraCtl");
|
|
196
|
-
Cam_ControlInit(obj, 0, 0, 600, 400);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
window.onload = function () {
|
|
201
|
-
console.log("window.onload");
|
|
202
|
-
}
|
|
203
196
|
|
|
197
|
+
/*********************
|
|
198
|
+
*** 初始化操作 ***
|
|
199
|
+
**********************/
|
|
204
200
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
var width = parseInt(restr.substring(0, pos));
|
|
214
|
-
var height = parseInt(restr.substring(pos + 1, restr.length));
|
|
215
|
-
Cam_Open(CamID, width, height);
|
|
216
|
-
}
|
|
201
|
+
function LoadCameraDocument() {
|
|
202
|
+
if (!window.WebSocket) {
|
|
203
|
+
alert("浏览器不支持HTML5,请更新或者使用其它浏览器!");
|
|
204
|
+
}
|
|
205
|
+
//console.log("LoadCameraDocument");
|
|
206
|
+
var obj = document.getElementById("CameraCtl");
|
|
207
|
+
Cam_ControlInit(obj, 0, 0, 600, 400);
|
|
208
|
+
}
|
|
217
209
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
function toCloseCamera() {
|
|
222
|
-
Cam_Close();
|
|
223
|
-
}
|
|
210
|
+
window.onload = function () {
|
|
211
|
+
console.log("window.onload");
|
|
212
|
+
};
|
|
224
213
|
|
|
225
214
|
/*********************
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
var CamID = document.getElementById("DevName").selectedIndex;
|
|
238
|
-
//获取分辨率
|
|
239
|
-
Cam_GetDevResolution(CamID);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
/*********************
|
|
244
|
-
*** 切换分辨率 ***
|
|
245
|
-
**********************/
|
|
246
|
-
function SelectResolution() {
|
|
247
|
-
var obj = document.getElementById("DevResolution");
|
|
248
|
-
var restr = obj[obj.selectedIndex].text;
|
|
249
|
-
var pos = restr.lastIndexOf("*");
|
|
250
|
-
var width = parseInt(restr.substring(0, pos));
|
|
251
|
-
var height = parseInt(restr.substring(pos + 1, restr.length));
|
|
252
|
-
var CamID = document.getElementById("DevName").selectedIndex;
|
|
253
|
-
Cam_Open(CamID, width, height);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
/*********************
|
|
258
|
-
*** 拍照 ***
|
|
259
|
-
**********************/
|
|
260
|
-
function TakePhoto() {
|
|
261
|
-
|
|
262
|
-
var name = formatDate(new Date().getTime());
|
|
263
|
-
|
|
264
|
-
var obj = document.getElementById("FileType");
|
|
265
|
-
var path;
|
|
266
|
-
Cam_SetFileType(obj.selectedIndex); //设置文件格式
|
|
267
|
-
if (obj.selectedIndex == 0) {
|
|
268
|
-
path = "D:\\" + name + ".jpg";
|
|
269
|
-
}
|
|
270
|
-
else if (obj.selectedIndex == 1) {
|
|
271
|
-
path = "D:\\" + name + ".png";
|
|
272
|
-
}
|
|
273
|
-
else if (obj.selectedIndex == 2) {
|
|
274
|
-
path = "D:\\" + name + ".tif";
|
|
275
|
-
}
|
|
276
|
-
else if (obj.selectedIndex == 3) {
|
|
277
|
-
path = "D:\\" + name + ".pdf";
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
path = "D:\\" + name + ".jpg";
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
Cam_Photo(path); //主摄像头拍照
|
|
284
|
-
//Cam_Photo(""); //传空路径拍照获取Base64
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
function SetCameraCutMode() {
|
|
291
|
-
Cam_SetCutMode(1);
|
|
292
|
-
// if (document.getElementById("Radio1").checked) {
|
|
293
|
-
// Cam_SetCutMode(0);
|
|
294
|
-
// }
|
|
295
|
-
// if (document.getElementById("Radio3").checked) {
|
|
296
|
-
// Cam_SetCutMode(1);
|
|
297
|
-
// }
|
|
298
|
-
// if (document.getElementById("Radio2").checked) {
|
|
299
|
-
// Cam_SetCutMode(2);
|
|
300
|
-
// }
|
|
301
|
-
// if (document.getElementById("Radio4").checked) {
|
|
302
|
-
|
|
303
|
-
// Cam_SetCutMode(3);
|
|
304
|
-
// //设置裁剪区域
|
|
305
|
-
// //toSleep(100);
|
|
306
|
-
// //console.log("SetCustomArea");
|
|
307
|
-
// SetCustomArea(3000, 3000, 9000, 9000);
|
|
308
|
-
// }
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
/*********************
|
|
313
|
-
*** 读取身份证 ***
|
|
314
|
-
**********************/
|
|
315
|
-
function GetIdCardInfo() {
|
|
316
|
-
var path = "D:\\IdCard.jpg";
|
|
317
|
-
Cam_ReadIdCard(path);
|
|
318
|
-
//Cam_ReadIdCard("");
|
|
319
|
-
}
|
|
215
|
+
*** 打开摄像头 ***
|
|
216
|
+
**********************/
|
|
217
|
+
function toOpenCamera() {
|
|
218
|
+
var CamID = document.getElementById("DevName").selectedIndex;
|
|
219
|
+
var obj = document.getElementById("DevResolution");
|
|
220
|
+
var restr = obj[obj.selectedIndex].text;
|
|
221
|
+
var pos = restr.lastIndexOf("*");
|
|
222
|
+
var width = parseInt(restr.substring(0, pos));
|
|
223
|
+
var height = parseInt(restr.substring(pos + 1, restr.length));
|
|
224
|
+
Cam_Open(CamID, width, height);
|
|
225
|
+
}
|
|
320
226
|
|
|
227
|
+
/*********************
|
|
228
|
+
*** 关闭摄像头 ***
|
|
229
|
+
**********************/
|
|
230
|
+
function toCloseCamera() {
|
|
231
|
+
Cam_Close();
|
|
232
|
+
}
|
|
321
233
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}
|
|
234
|
+
/*********************
|
|
235
|
+
*** 关闭弹窗 ***
|
|
236
|
+
**********************/
|
|
237
|
+
function toCloseModal() {
|
|
238
|
+
window.onbeforeunload();
|
|
239
|
+
}
|
|
329
240
|
|
|
241
|
+
/*********************
|
|
242
|
+
*** 切换摄像头 ***
|
|
243
|
+
**********************/
|
|
244
|
+
function SelectDevice() {
|
|
245
|
+
var CamID = document.getElementById("DevName").selectedIndex;
|
|
246
|
+
//获取分辨率
|
|
247
|
+
Cam_GetDevResolution(CamID);
|
|
248
|
+
}
|
|
330
249
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
250
|
+
/*********************
|
|
251
|
+
*** 切换分辨率 ***
|
|
252
|
+
**********************/
|
|
253
|
+
function SelectResolution() {
|
|
254
|
+
var obj = document.getElementById("DevResolution");
|
|
255
|
+
var restr = obj[obj.selectedIndex].text;
|
|
256
|
+
var pos = restr.lastIndexOf("*");
|
|
257
|
+
var width = parseInt(restr.substring(0, pos));
|
|
258
|
+
var height = parseInt(restr.substring(pos + 1, restr.length));
|
|
259
|
+
var CamID = document.getElementById("DevName").selectedIndex;
|
|
260
|
+
Cam_Open(CamID, width, height);
|
|
261
|
+
}
|
|
338
262
|
|
|
263
|
+
/*********************
|
|
264
|
+
*** 拍照 ***
|
|
265
|
+
**********************/
|
|
266
|
+
function TakePhoto() {
|
|
267
|
+
var name = formatDate(new Date().getTime());
|
|
268
|
+
|
|
269
|
+
var obj = document.getElementById("FileType");
|
|
270
|
+
var path;
|
|
271
|
+
Cam_SetFileType(obj.selectedIndex); //设置文件格式
|
|
272
|
+
if (obj.selectedIndex == 0) {
|
|
273
|
+
path = "D:\\" + name + ".jpg";
|
|
274
|
+
} else if (obj.selectedIndex == 1) {
|
|
275
|
+
path = "D:\\" + name + ".png";
|
|
276
|
+
} else if (obj.selectedIndex == 2) {
|
|
277
|
+
path = "D:\\" + name + ".tif";
|
|
278
|
+
} else if (obj.selectedIndex == 3) {
|
|
279
|
+
path = "D:\\" + name + ".pdf";
|
|
280
|
+
} else {
|
|
281
|
+
path = "D:\\" + name + ".jpg";
|
|
282
|
+
}
|
|
339
283
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
function toSetJpgQuality() {
|
|
344
|
-
var obj = document.getElementById("JpgQuality");
|
|
345
|
-
var val = obj[obj.selectedIndex].text;
|
|
346
|
-
Cam_SetJpgQuality(parseInt(val));
|
|
347
|
-
}
|
|
284
|
+
Cam_Photo(path); //主摄像头拍照
|
|
285
|
+
//Cam_Photo(""); //传空路径拍照获取Base64
|
|
286
|
+
}
|
|
348
287
|
|
|
288
|
+
function SetCameraCutMode() {
|
|
289
|
+
Cam_SetCutMode(1);
|
|
290
|
+
// if (document.getElementById("Radio1").checked) {
|
|
291
|
+
// Cam_SetCutMode(0);
|
|
292
|
+
// }
|
|
293
|
+
// if (document.getElementById("Radio3").checked) {
|
|
294
|
+
// Cam_SetCutMode(1);
|
|
295
|
+
// }
|
|
296
|
+
// if (document.getElementById("Radio2").checked) {
|
|
297
|
+
// Cam_SetCutMode(2);
|
|
298
|
+
// }
|
|
299
|
+
// if (document.getElementById("Radio4").checked) {
|
|
349
300
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
Cam_SetDeleteBlackEdge(1);
|
|
357
|
-
}
|
|
358
|
-
else {
|
|
359
|
-
Cam_SetDeleteBlackEdge(0);
|
|
301
|
+
// Cam_SetCutMode(3);
|
|
302
|
+
// //设置裁剪区域
|
|
303
|
+
// //toSleep(100);
|
|
304
|
+
// //console.log("SetCustomArea");
|
|
305
|
+
// SetCustomArea(3000, 3000, 9000, 9000);
|
|
306
|
+
// }
|
|
360
307
|
}
|
|
361
|
-
}
|
|
362
308
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
309
|
+
/*********************
|
|
310
|
+
*** 读取身份证 ***
|
|
311
|
+
**********************/
|
|
312
|
+
function GetIdCardInfo() {
|
|
313
|
+
var path = "D:\\IdCard.jpg";
|
|
314
|
+
Cam_ReadIdCard(path);
|
|
315
|
+
//Cam_ReadIdCard("");
|
|
370
316
|
}
|
|
371
|
-
|
|
372
|
-
|
|
317
|
+
|
|
318
|
+
/*********************
|
|
319
|
+
*** 设置文件格式 ***
|
|
320
|
+
**********************/
|
|
321
|
+
function toSetFileType() {
|
|
322
|
+
var obj = document.getElementById("FileType");
|
|
323
|
+
Cam_SetFileType(obj.selectedIndex);
|
|
373
324
|
}
|
|
374
|
-
}
|
|
375
325
|
|
|
326
|
+
/*********************
|
|
327
|
+
*** 设置色彩模式 ***
|
|
328
|
+
**********************/
|
|
329
|
+
function toSetColorModel() {
|
|
330
|
+
var obj = document.getElementById("ColorMode");
|
|
331
|
+
Cam_SetColorMode(obj.selectedIndex);
|
|
332
|
+
}
|
|
376
333
|
|
|
334
|
+
/*********************
|
|
335
|
+
*** 设置JPG图像质量 ***
|
|
336
|
+
**********************/
|
|
337
|
+
function toSetJpgQuality() {
|
|
338
|
+
var obj = document.getElementById("JpgQuality");
|
|
339
|
+
var val = obj[obj.selectedIndex].text;
|
|
340
|
+
Cam_SetJpgQuality(parseInt(val));
|
|
341
|
+
}
|
|
377
342
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
343
|
+
/*********************
|
|
344
|
+
*** 设置去黑边 ***
|
|
345
|
+
**********************/
|
|
346
|
+
function toSetDeleteBlackEdge() {
|
|
347
|
+
var obj = document.getElementById("Checkbox1");
|
|
348
|
+
if (obj.checked) {
|
|
349
|
+
Cam_SetDeleteBlackEdge(1);
|
|
350
|
+
} else {
|
|
351
|
+
Cam_SetDeleteBlackEdge(0);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
381
354
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
var
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
//从摄像头中识别二维码
|
|
394
|
-
function RecogQrCodeFromCamera(type) {
|
|
395
|
-
Cam_RecogQrBarCodeFromCamera(type)
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
//从图片文件中识别二维码
|
|
399
|
-
function RecogBarCodeFromFile(type) {
|
|
400
|
-
var imgpath = "D:\\123.jpg";
|
|
401
|
-
Cam_RecogQrBarCodeFromFile(type, imgpath)
|
|
402
|
-
}
|
|
355
|
+
/*********************
|
|
356
|
+
*** 设置去底色 ***
|
|
357
|
+
**********************/
|
|
358
|
+
function toSetDeleteBgColor() {
|
|
359
|
+
var obj = document.getElementById("Checkbox2");
|
|
360
|
+
if (obj.checked) {
|
|
361
|
+
Cam_SetDeleteBgColor(1);
|
|
362
|
+
} else {
|
|
363
|
+
Cam_SetDeleteBgColor(0);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
403
366
|
|
|
367
|
+
/*********************
|
|
368
|
+
****** 上传方法2 ******
|
|
369
|
+
**********************/
|
|
370
|
+
|
|
371
|
+
function HttpUploadFile() {
|
|
372
|
+
//fileBase64Str在拍照回调函数中赋值,用于测试上传方法2
|
|
373
|
+
if (fileBase64Str != "") {
|
|
374
|
+
var pos = file_path.lastIndexOf("\\");
|
|
375
|
+
var filename = file_path.substring(pos + 1, file_path.length);
|
|
376
|
+
//UpladFile方法在upload.js实现
|
|
377
|
+
// UpladFile("http://localhost:/api/contract-management/upload/contract", fileBase64Str, filename, HttpResultCallBak);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
404
380
|
|
|
381
|
+
//从摄像头中识别二维码
|
|
382
|
+
function RecogQrCodeFromCamera(type) {
|
|
383
|
+
Cam_RecogQrBarCodeFromCamera(type);
|
|
384
|
+
}
|
|
405
385
|
|
|
386
|
+
//从图片文件中识别二维码
|
|
387
|
+
function RecogBarCodeFromFile(type) {
|
|
388
|
+
var imgpath = "D:\\123.jpg";
|
|
389
|
+
Cam_RecogQrBarCodeFromFile(type, imgpath);
|
|
390
|
+
}
|
|
406
391
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
392
|
+
//添加要合并的PDF文件
|
|
393
|
+
function ToAddPDFFile() {
|
|
394
|
+
// Cam_AddImgFileToPDF("D:\\1.jpg");
|
|
395
|
+
// sleep(100);
|
|
396
|
+
// Cam_AddImgFileToPDF("D:\\2.jpg");
|
|
397
|
+
// sleep(100);
|
|
398
|
+
// Cam_AddImgFileToPDF("D:\\3.jpg");
|
|
399
|
+
// sleep(100);
|
|
415
400
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
401
|
+
Cam_AddImgFileToPDF("");
|
|
402
|
+
sleep(100);
|
|
403
|
+
}
|
|
419
404
|
|
|
420
|
-
|
|
405
|
+
/*---------------------------------------------------
|
|
421
406
|
-------- 添加合并的PDF文件返回结果 ---------
|
|
422
407
|
----------------------------------------------------*/
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
408
|
+
function AddImgFileToPDFResultCB(flag, base64Str) {
|
|
409
|
+
if (flag == 0) {
|
|
410
|
+
window.parent.postMessage({ message: "添加合并的PDF文件成功", messageId: messageId }, "*");
|
|
411
|
+
var obj = document.getElementById("CameraPhoto");
|
|
412
|
+
obj.src = "data:;base64," + base64Str;
|
|
413
|
+
} else {
|
|
414
|
+
window.parent.postMessage({ error: "添加合并的PDF文件失败", messageId: messageId }, "*");
|
|
415
|
+
}
|
|
431
416
|
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
417
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
418
|
+
//PDF合并测试
|
|
419
|
+
function ToCombinePDF() {
|
|
420
|
+
Cam_CombinePDF("D:\\test.pdf");
|
|
421
|
+
//Cam_CombinePDF("");
|
|
422
|
+
}
|
|
440
423
|
|
|
441
|
-
|
|
424
|
+
/*---------------------------------------------------
|
|
442
425
|
-------- (必须重写该函数)合并PDF结果 ---------
|
|
443
426
|
----------------------------------------------------*/
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
427
|
+
function PdfCombineResultCB(flag, PdfBase64Str) {
|
|
428
|
+
if (flag == 0) {
|
|
429
|
+
window.parent.postMessage({ message: "合并PDF完成, messageId: messageId" }, "*");
|
|
430
|
+
console.log(PdfBase64Str);
|
|
431
|
+
} else {
|
|
432
|
+
window.parent.postMessage({ error: "合并PDF失败", messageId: messageId }, "*");
|
|
433
|
+
}
|
|
451
434
|
}
|
|
452
|
-
}
|
|
453
435
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
436
|
+
//添加要合并的图像文件
|
|
437
|
+
var MergeCount = 0;
|
|
438
|
+
function ToAddMergeImageFile() {
|
|
439
|
+
MergeCount++;
|
|
440
|
+
if (MergeCount > 4) {
|
|
441
|
+
window.parent.postMessage(
|
|
442
|
+
{ error: "提示:图像合并最多支持四页合并", messageId: messageId },
|
|
443
|
+
"*"
|
|
444
|
+
);
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
Cam_AddMergeImageFile("");
|
|
448
|
+
sleep(100);
|
|
462
449
|
}
|
|
463
|
-
Cam_AddMergeImageFile("");
|
|
464
|
-
sleep(100);
|
|
465
|
-
}
|
|
466
450
|
|
|
467
|
-
|
|
451
|
+
/*---------------------------------------------------
|
|
468
452
|
-------- 添加合并图像文件返回结果 ---------
|
|
469
453
|
----------------------------------------------------*/
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
454
|
+
function AddMergeImageFileResultCB(flag, base64Str) {
|
|
455
|
+
if (flag == 0) {
|
|
456
|
+
window.parent.postMessage({ message: "添加合并图像文件成功", messageId: messageId }, "*");
|
|
457
|
+
var obj = document.getElementById("CameraPhoto");
|
|
458
|
+
obj.src = "data:;base64," + base64Str;
|
|
459
|
+
} else {
|
|
460
|
+
window.parent.postMessage({ error: "添加合并图像文件失败", messageId: messageId }, "*");
|
|
461
|
+
}
|
|
478
462
|
}
|
|
479
|
-
}
|
|
480
463
|
|
|
464
|
+
//图像合并测试
|
|
465
|
+
function ToMergeImages() {
|
|
466
|
+
MergeCount = 0;
|
|
467
|
+
Cam_MergeImages("D:\\merge.jpg", 0);
|
|
468
|
+
}
|
|
481
469
|
|
|
482
|
-
|
|
483
|
-
function ToMergeImages() {
|
|
484
|
-
MergeCount = 0;
|
|
485
|
-
Cam_MergeImages("D:\\merge.jpg", 0);
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
/*---------------------------------------------------
|
|
470
|
+
/*---------------------------------------------------
|
|
489
471
|
-------- (必须重写该函数)图像合并结果 ---------
|
|
490
472
|
----------------------------------------------------*/
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
473
|
+
function MergeImagesResultCB(flag, base64Str) {
|
|
474
|
+
if (flag == 0) {
|
|
475
|
+
window.parent.postMessage({ message: "图像合并完成" , messageId: messageId}, "*");
|
|
476
|
+
var obj = document.getElementById("CameraPhoto");
|
|
477
|
+
obj.src = "data:;base64," + base64Str;
|
|
478
|
+
} else {
|
|
479
|
+
window.parent.postMessage({ error: "图像合并失败", messageId: messageId }, "*");
|
|
480
|
+
}
|
|
499
481
|
}
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
|
|
503
482
|
|
|
504
|
-
|
|
505
|
-
/*---------------------------------------------------
|
|
483
|
+
/*---------------------------------------------------
|
|
506
484
|
-------(必须重写该函数)获取驱动盘符返回结果--------
|
|
507
485
|
----------------------------------------------------*/
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
//设置水印
|
|
519
|
-
function toSetWaterMarkParams() {
|
|
520
|
-
var isAddMark;
|
|
521
|
-
var isAddTime;
|
|
522
|
-
var wTransp;
|
|
523
|
-
var wPos;
|
|
524
|
-
var wSize;
|
|
525
|
-
var wColor;
|
|
526
|
-
var szInfo;
|
|
527
|
-
var obj = document.getElementById("Checkbox3");
|
|
528
|
-
if (obj.checked)
|
|
529
|
-
isAddMark = 1;
|
|
530
|
-
else
|
|
531
|
-
isAddMark = 0;
|
|
532
|
-
obj = document.getElementById("Checkbox4");
|
|
533
|
-
if (obj.checked)
|
|
534
|
-
isAddTime = 1;
|
|
535
|
-
else
|
|
536
|
-
isAddTime = 0;
|
|
537
|
-
szInfo = document.getElementById("Text1").value; //水印内容
|
|
538
|
-
wTransp = parseInt(document.getElementById("Text2").value); //透明度
|
|
539
|
-
wSize = parseInt(document.getElementById("Text3").value); //水印大小
|
|
540
|
-
wPos = document.getElementById("Select1").selectedIndex; //水印位置
|
|
541
|
-
wColor = document.getElementById("Select2").selectedIndex; //水印颜色
|
|
542
|
-
SetWaterMark(isAddMark, 0, isAddTime, wTransp, wPos, wSize, wColor, szInfo); //生效水印设置
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
//删除文件
|
|
548
|
-
function ToDeleteFile() {
|
|
549
|
-
var path = "D:\\20220623140215.jpg";
|
|
550
|
-
DeleteFile(path);
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
//删除文件返回结果
|
|
554
|
-
function GetDeleteFileResultCB(flag) {
|
|
555
|
-
if (flag == 0) {
|
|
556
|
-
window.parent.postMessage({ message: "删除文件成功" }, '*')
|
|
557
|
-
}
|
|
558
|
-
else {
|
|
559
|
-
window.parent.postMessage({ error: "删除文件失败!" }, '*')
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
</script>
|
|
565
|
-
|
|
566
|
-
<body onload="LoadCameraDocument()">
|
|
567
|
-
|
|
568
|
-
<div style="width:602px; height: 400px; border: 1px solid white; background:#DEDEBE; font-size:14px; float:left;">
|
|
569
|
-
|
|
570
|
-
<div id='Div1' style="width:600px; height: 300px">
|
|
571
|
-
<div id='CameraCtl' style="width:600px; height: 300px; float:left"> </div>
|
|
572
|
-
</div>
|
|
573
|
-
<div style="visibility: hidden;" >
|
|
574
|
-
设备
|
|
575
|
-
<select style="width:140px" id="DevName" onchange="SelectDevice()"></select>
|
|
576
|
-
分辨率
|
|
577
|
-
<select style="width:140px" id="DevResolution" onchange="SelectResolution()"></select>
|
|
578
|
-
<input type="button" value=" 打开设备 " onclick="toOpenCamera();" />
|
|
579
|
-
<input type="button" id="closeDeviceButton" onclick="toCloseModal()" />
|
|
580
|
-
<br />
|
|
486
|
+
function GetDriveResultCB(driveStr) {
|
|
487
|
+
if (driveStr == "") {
|
|
488
|
+
window.parent.postMessage({ error: "获取盘符失败", messageId: messageId }, "*");
|
|
489
|
+
} else {
|
|
490
|
+
window.parent.postMessage({ message: "获取盘符:" + driveStr , messageId: messageId}, "*");
|
|
491
|
+
}
|
|
492
|
+
}
|
|
581
493
|
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
494
|
+
//设置水印
|
|
495
|
+
function toSetWaterMarkParams() {
|
|
496
|
+
var isAddMark;
|
|
497
|
+
var isAddTime;
|
|
498
|
+
var wTransp;
|
|
499
|
+
var wPos;
|
|
500
|
+
var wSize;
|
|
501
|
+
var wColor;
|
|
502
|
+
var szInfo;
|
|
503
|
+
var obj = document.getElementById("Checkbox3");
|
|
504
|
+
if (obj.checked) isAddMark = 1;
|
|
505
|
+
else isAddMark = 0;
|
|
506
|
+
obj = document.getElementById("Checkbox4");
|
|
507
|
+
if (obj.checked) isAddTime = 1;
|
|
508
|
+
else isAddTime = 0;
|
|
509
|
+
szInfo = document.getElementById("Text1").value; //水印内容
|
|
510
|
+
wTransp = parseInt(document.getElementById("Text2").value); //透明度
|
|
511
|
+
wSize = parseInt(document.getElementById("Text3").value); //水印大小
|
|
512
|
+
wPos = document.getElementById("Select1").selectedIndex; //水印位置
|
|
513
|
+
wColor = document.getElementById("Select2").selectedIndex; //水印颜色
|
|
514
|
+
SetWaterMark(
|
|
515
|
+
isAddMark,
|
|
516
|
+
0,
|
|
517
|
+
isAddTime,
|
|
518
|
+
wTransp,
|
|
519
|
+
wPos,
|
|
520
|
+
wSize,
|
|
521
|
+
wColor,
|
|
522
|
+
szInfo
|
|
523
|
+
); //生效水印设置
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
//删除文件
|
|
527
|
+
function ToDeleteFile() {
|
|
528
|
+
var path = "D:\\20220623140215.jpg";
|
|
529
|
+
DeleteFile(path);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
//删除文件返回结果
|
|
533
|
+
function GetDeleteFileResultCB(flag) {
|
|
534
|
+
if (flag == 0) {
|
|
535
|
+
window.parent.postMessage({ message: "删除文件成功", messageId: messageId }, "*");
|
|
536
|
+
} else {
|
|
537
|
+
window.parent.postMessage({ error: "删除文件失败!", messageId: messageId }, "*");
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
</script>
|
|
541
|
+
|
|
542
|
+
<body onload="LoadCameraDocument()">
|
|
543
|
+
<div
|
|
544
|
+
style="
|
|
545
|
+
width: 602px;
|
|
546
|
+
height: 400px;
|
|
547
|
+
border: 1px solid white;
|
|
548
|
+
background: #dedebe;
|
|
549
|
+
font-size: 14px;
|
|
550
|
+
float: left;
|
|
551
|
+
"
|
|
552
|
+
>
|
|
553
|
+
<div id="Div1" style="width: 600px; height: 300px">
|
|
554
|
+
<div
|
|
555
|
+
id="CameraCtl"
|
|
556
|
+
style="width: 600px; height: 300px; float: left"
|
|
557
|
+
></div>
|
|
558
|
+
</div>
|
|
559
|
+
<div style="visibility: hidden">
|
|
560
|
+
设备
|
|
561
|
+
<select
|
|
562
|
+
style="width: 140px"
|
|
563
|
+
id="DevName"
|
|
564
|
+
onchange="SelectDevice()"
|
|
565
|
+
></select>
|
|
566
|
+
分辨率
|
|
567
|
+
<select
|
|
568
|
+
style="width: 140px"
|
|
569
|
+
id="DevResolution"
|
|
570
|
+
onchange="SelectResolution()"
|
|
571
|
+
></select>
|
|
572
|
+
<input type="button" value=" 打开设备 " onclick="toOpenCamera();" />
|
|
573
|
+
<input type="button" id="closeDeviceButton" onclick="toCloseModal()" />
|
|
574
|
+
<br />
|
|
575
|
+
|
|
576
|
+
裁切模式:
|
|
577
|
+
<input
|
|
578
|
+
id="Radio1"
|
|
579
|
+
name="R1"
|
|
580
|
+
type="radio"
|
|
581
|
+
value="V1"
|
|
582
|
+
onclick="SetCameraCutMode()"
|
|
583
|
+
checked="checked"
|
|
584
|
+
/>不裁切
|
|
585
|
+
<input
|
|
586
|
+
id="Radio2"
|
|
587
|
+
name="R1"
|
|
588
|
+
type="radio"
|
|
589
|
+
value="V2"
|
|
590
|
+
onclick="SetCameraCutMode()"
|
|
591
|
+
/>手动裁切
|
|
592
|
+
<input
|
|
593
|
+
id="Radio3"
|
|
594
|
+
name="R1"
|
|
595
|
+
type="radio"
|
|
596
|
+
value="V3"
|
|
597
|
+
onclick="SetCameraCutMode()"
|
|
598
|
+
/>自动裁切
|
|
599
|
+
<input
|
|
600
|
+
id="Radio4"
|
|
601
|
+
name="R1"
|
|
602
|
+
type="radio"
|
|
603
|
+
value="V4"
|
|
604
|
+
onclick="SetCameraCutMode()"
|
|
605
|
+
/>自定义
|
|
606
|
+
<br />
|
|
607
|
+
|
|
608
|
+
文件格式:
|
|
609
|
+
<select id="FileType" onchange="toSetFileType()">
|
|
610
|
+
<option value="0">jpg</option>
|
|
611
|
+
<option value="1">png</option>
|
|
612
|
+
<option value="2">tif</option>
|
|
613
|
+
<option value="3">pdf</option>
|
|
614
|
+
</select>
|
|
615
|
+
|
|
616
|
+
色彩模式:
|
|
617
|
+
<select id="ColorMode" onchange="toSetColorModel()">
|
|
618
|
+
<option value="0">彩色</option>
|
|
619
|
+
<option value="1">灰度</option>
|
|
620
|
+
<option value="2">黑白</option>
|
|
621
|
+
</select>
|
|
622
|
+
|
|
623
|
+
图像质量:
|
|
624
|
+
<select id="JpgQuality" onchange="toSetJpgQuality()">
|
|
625
|
+
<option value="0">10</option>
|
|
626
|
+
<option value="1">20</option>
|
|
627
|
+
<option value="2">30</option>
|
|
628
|
+
<option value="3">40</option>
|
|
629
|
+
<option value="4">50</option>
|
|
630
|
+
<option value="5" selected="true">60</option>
|
|
631
|
+
<option value="6">70</option>
|
|
632
|
+
<option value="7">80</option>
|
|
633
|
+
<option value="8">90</option>
|
|
634
|
+
<option value="9">100</option>
|
|
635
|
+
</select>
|
|
636
|
+
|
|
637
|
+
<input
|
|
638
|
+
id="Checkbox1"
|
|
639
|
+
type="checkbox"
|
|
640
|
+
onclick="toSetDeleteBlackEdge()"
|
|
641
|
+
/>
|
|
642
|
+
去黑边
|
|
643
|
+
<input id="Checkbox2" type="checkbox" onclick="toSetDeleteBgColor()" />
|
|
644
|
+
去底色
|
|
645
|
+
</div>
|
|
587
646
|
<br />
|
|
588
647
|
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
<
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
<
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
648
|
+
<div style="border: 1px dashed #000; visibility: hidden; height: 0">
|
|
649
|
+
<input id="Checkbox3" type="checkbox" /> 添加水印 水印内容<input
|
|
650
|
+
id="Text1"
|
|
651
|
+
type="text"
|
|
652
|
+
value="水印测试"
|
|
653
|
+
/>
|
|
654
|
+
透明度<input id="Text2" type="text" value="127" style="width: 40px" />
|
|
655
|
+
大小<input id="Text3" type="text" value="80" style="width: 40px" />
|
|
656
|
+
<br />
|
|
657
|
+
位置
|
|
658
|
+
<select id="Select1">
|
|
659
|
+
<option value="0">左上</option>
|
|
660
|
+
<option value="1">右上</option>
|
|
661
|
+
<option value="2">左下</option>
|
|
662
|
+
<option value="3">右下</option>
|
|
663
|
+
<option value="4">中间</option>
|
|
664
|
+
</select>
|
|
665
|
+
颜色
|
|
666
|
+
<select id="Select2">
|
|
667
|
+
<option value="0">红色</option>
|
|
668
|
+
<option value="1">绿色</option>
|
|
669
|
+
<option value="2">蓝色</option>
|
|
670
|
+
<option value="3">青色</option>
|
|
671
|
+
<option value="4">黄色</option>
|
|
672
|
+
<option value="5">白色</option>
|
|
673
|
+
<option value="6">黑色</option>
|
|
674
|
+
</select>
|
|
675
|
+
<input id="Checkbox4" type="checkbox" /> 添加时间水印
|
|
676
|
+
<input
|
|
677
|
+
type="button"
|
|
678
|
+
value="生效水印参数设置"
|
|
679
|
+
onclick="toSetWaterMarkParams()"
|
|
680
|
+
/>
|
|
681
|
+
</div>
|
|
620
682
|
|
|
621
|
-
|
|
622
|
-
<br />
|
|
623
|
-
|
|
624
|
-
<div style="border:1px dashed #000;visibility: hidden;height:0;">
|
|
625
|
-
<input id="Checkbox3" type="checkbox" /> 添加水印
|
|
626
|
-
水印内容<input id="Text1" type="text" value="水印测试" />
|
|
627
|
-
透明度<input id="Text2" type="text" value="127" style="width:40px" />
|
|
628
|
-
大小<input id="Text3" type="text" value="80" style="width:40px" /> <br />
|
|
629
|
-
位置
|
|
630
|
-
<select id="Select1">
|
|
631
|
-
<option value="0">左上</option>
|
|
632
|
-
<option value="1">右上</option>
|
|
633
|
-
<option value="2">左下</option>
|
|
634
|
-
<option value="3">右下</option>
|
|
635
|
-
<option value="4">中间</option>
|
|
636
|
-
</select>
|
|
637
|
-
颜色
|
|
638
|
-
<select id="Select2">
|
|
639
|
-
<option value="0">红色</option>
|
|
640
|
-
<option value="1">绿色</option>
|
|
641
|
-
<option value="2">蓝色</option>
|
|
642
|
-
<option value="3">青色</option>
|
|
643
|
-
<option value="4">黄色</option>
|
|
644
|
-
<option value="5">白色</option>
|
|
645
|
-
<option value="6">黑色</option>
|
|
646
|
-
</select>
|
|
647
|
-
<input id="Checkbox4" type="checkbox" /> 添加时间水印
|
|
648
|
-
<input type="button" value="生效水印参数设置" onclick="toSetWaterMarkParams()" />
|
|
649
|
-
</div>
|
|
683
|
+
<br />
|
|
650
684
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
685
|
+
<div style="visibility: hidden; height: 0; margin-bottom: 20px">
|
|
686
|
+
<input type="button" value="获取盘符" onclick="GetDrives();" />
|
|
687
|
+
<input type="button" value="放大" onclick="Cam_ZoomIn();" />
|
|
688
|
+
<input type="button" value="缩小" onclick="Cam_ZoomOut();" />
|
|
689
|
+
<input type="button" value="适屏" onclick="Cam_BestSize();" />
|
|
690
|
+
<input type="button" value="1:1" onclick="Cam_TrueSize();" />
|
|
691
|
+
<input type="button" value="左旋" onclick="Cam_RotateLeft();" />
|
|
692
|
+
<input type="button" value="右旋" onclick="Cam_RotateRight();" />
|
|
693
|
+
<input type="button" value="对焦" onclick="Cam_Focus();" />
|
|
694
|
+
<input type="button" value="设置" onclick="Cam_ShowVideoProp();" />
|
|
695
|
+
<input type="button" value="拍照" onclick="TakePhoto();" />
|
|
696
|
+
<!-- <input type="button" value="读身份证" onclick="GetIdCardInfo();" /> -->
|
|
697
|
+
<input
|
|
698
|
+
type="button"
|
|
699
|
+
value="从摄像头中识别二维码"
|
|
700
|
+
onclick="RecogQrCodeFromCamera(1);"
|
|
701
|
+
/>
|
|
702
|
+
<!-- <input type="button" value="从图片中识别二维码" onclick="RecogBarCodeFromFile(1);" /> -->
|
|
703
|
+
<input
|
|
704
|
+
type="button"
|
|
705
|
+
value="添加合并PDF文件"
|
|
706
|
+
onclick="ToAddPDFFile();"
|
|
707
|
+
/>
|
|
708
|
+
<input type="button" value="合并PDF" onclick="ToCombinePDF();" />
|
|
709
|
+
<!-- <input type="button" value="添加合并图像文件" onclick="ToAddMergeImageFile();" />
|
|
670
710
|
<input type="button" value="合并图像" onclick="ToMergeImages();" /> -->
|
|
671
|
-
|
|
672
|
-
|
|
711
|
+
<!-- <input type="button" value="删除文件" onclick="ToDeleteFile();" /> -->
|
|
712
|
+
<!-- <input type="button" value="上传" onclick="HttpUploadFile();" /> -->
|
|
713
|
+
</div>
|
|
714
|
+
<input
|
|
715
|
+
style="width: 100%; height: 30px"
|
|
716
|
+
type="button"
|
|
717
|
+
value="拍照"
|
|
718
|
+
onclick="TakePhoto();"
|
|
719
|
+
/>
|
|
720
|
+
|
|
721
|
+
<div></div>
|
|
673
722
|
</div>
|
|
674
|
-
<input style="width: 100%;height: 30px;" type="button" value="拍照" onclick="TakePhoto();" />
|
|
675
|
-
|
|
676
|
-
<div>
|
|
677
723
|
|
|
724
|
+
<div
|
|
725
|
+
style="
|
|
726
|
+
width: 202px;
|
|
727
|
+
border: 1px solid white;
|
|
728
|
+
background: #dedebe;
|
|
729
|
+
font-size: 14px;
|
|
730
|
+
float: left;
|
|
731
|
+
display: none;
|
|
732
|
+
"
|
|
733
|
+
>
|
|
734
|
+
拍照图片
|
|
735
|
+
<br />
|
|
736
|
+
<img id="CameraPhoto" src="" style="width: 200px" />
|
|
678
737
|
</div>
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
<div style="width:202px; border: 1px solid white; background:#DEDEBE; font-size:14px; float:left;display: none;">
|
|
684
|
-
拍照图片
|
|
685
|
-
<br />
|
|
686
|
-
<img id="CameraPhoto" src="" style="width: 200px;" />
|
|
687
|
-
</div>
|
|
688
|
-
|
|
689
|
-
</body>
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
</html>
|
|
738
|
+
</body>
|
|
739
|
+
</html>
|