TestDemo2.htm 28 KB

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