dwt 16.2.4 → 16.2.6
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/README.md +16 -12
- package/dist/addon/dbrjs/dbr-7.6.0.full.wasm.js +4016 -4016
- package/dist/addon/dbrjs/dbr-7.6.0.worker.js +107 -107
- package/dist/addon/dbrjs/dbr.js +10 -10
- package/dist/dist/DynamsoftServiceSetup.deb +0 -0
- package/dist/dist/DynamsoftServiceSetup.msi +0 -0
- package/dist/dist/DynamsoftServiceSetup.pkg +0 -0
- package/dist/dist/DynamsoftServiceSetup.rpm +0 -0
- package/dist/dist/LICENSE +95 -95
- package/dist/dynamsoft.webtwain.min.js +209 -209
- package/dist/dynamsoft.webtwain.min.mjs +208 -208
- package/dist/src/dynamsoft.imageio_wasm-1.6.2.js +93 -93
- package/dist/src/dynamsoft.webtwain.css +1045 -1045
- package/dist/types/Addon.BarcodeReader.d.ts +168 -168
- package/dist/types/Addon.Camera.d.ts +125 -125
- package/dist/types/Addon.OCR.d.ts +264 -264
- package/dist/types/Addon.OCRPro.d.ts +251 -251
- package/dist/types/Addon.PDF.d.ts +110 -110
- package/dist/types/Addon.Webcam.d.ts +257 -257
- package/dist/types/Dynamsoft.Enum.d.ts +1850 -1849
- package/dist/types/Dynamsoft.FileUploader.d.ts +130 -130
- package/dist/types/Dynamsoft.d.ts +495 -495
- package/dist/types/WebTwain.Acquire.d.ts +1059 -1059
- package/dist/types/WebTwain.Buffer.d.ts +259 -259
- package/dist/types/WebTwain.Edit.d.ts +434 -434
- package/dist/types/WebTwain.IO.d.ts +951 -951
- package/dist/types/WebTwain.Util.d.ts +102 -102
- package/dist/types/WebTwain.Viewer.d.ts +795 -795
- package/dist/types/WebTwain.d.ts +51 -51
- package/dist/types/index.d.ts +20 -20
- package/package.json +2 -2
- package/samples/1.AcquireImage.html +0 -69
- package/samples/2.CustomScan.html +0 -98
- package/samples/3.PDFRasterizer.html +0 -73
- package/samples/4.OCRADocument.html +0 -156
- package/samples/5.ReadBarcode.html +0 -231
- package/samples/6.ScanOrCapture.html +0 -189
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<title>Read Barcode on Scanned or Loaded Documents</title>
|
|
6
|
-
<script src="../dist/dynamsoft.webtwain.min.js"></script>
|
|
7
|
-
</head>
|
|
8
|
-
|
|
9
|
-
<body style="padding: 30px;">
|
|
10
|
-
<h1>Read Barcode on Scanned or Loaded Documents</h1>
|
|
11
|
-
<br />
|
|
12
|
-
<input id="scanButton" style="font-size: x-large;" type="button" value="Scan Documents" onclick="AcquireImage();" />
|
|
13
|
-
<input type="button" style="font-size: x-large;" id="loadButton" value="Load Images" onclick="LoadImages();" />
|
|
14
|
-
<input type="button" style="font-size: x-large; display: none;" id="loadPDF" value="Load PDF" onclick="LoadPDFs();" />
|
|
15
|
-
<select id="barcodeformat" style="font-size: x-large;"></select>
|
|
16
|
-
<input type="button" style="font-size: x-large;" value="Read Barcode" onclick="ReadBarcode();" />
|
|
17
|
-
<br />
|
|
18
|
-
<br />
|
|
19
|
-
<div id="dwtcontrolContainer" style="float:left;"></div>
|
|
20
|
-
<div id="divNoteMessage" ondblclick="this.innerHTML='';"
|
|
21
|
-
style="margin:0px 20px;float:left;width:300px; height:800px; overflow: auto;background-color:#e7f2fd;border:solid 1px black;">
|
|
22
|
-
</div>
|
|
23
|
-
<script type="text/javascript">
|
|
24
|
-
Dynamsoft.WebTwainEnv.ResourcesPath = "../dist";
|
|
25
|
-
Dynamsoft.WebTwainEnv.ProductKey = 't00911wAAADwPAaIxHA38XfQgvv+o7wY1qFx4aAL6m5W9nK9ulevyXbe4DIRCPw4FUKWxOQpvvGnefCmnCtBu/1TALNmgEBeWrEAOcP/Asw44TCBWNwip6r+8VPorfA==';
|
|
26
|
-
Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady);
|
|
27
|
-
window.onload = function () {
|
|
28
|
-
if (Dynamsoft.Lib.env.bMobile) {
|
|
29
|
-
document.getElementById('scanButton').style.display = "none";
|
|
30
|
-
document.getElementById('loadPDF').style.display = "";
|
|
31
|
-
}
|
|
32
|
-
Dynamsoft.WebTwainEnv.Containers = [{ ContainerId: 'dwtcontrolContainer', Width: 600, Height: 800 }];
|
|
33
|
-
Dynamsoft.WebTwainEnv.Load();
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
function fileChanged(inputTarget) {
|
|
37
|
-
DWObject.LoadImageFromBinary(
|
|
38
|
-
inputTarget.files[0],
|
|
39
|
-
function () { inputTarget.value = ""; },
|
|
40
|
-
function (errCode, errString) { alert(errString); });
|
|
41
|
-
}
|
|
42
|
-
var DWObject, dbrObject, barcodeText = [];
|
|
43
|
-
var BarcodeInfo = [{
|
|
44
|
-
desc: "All",
|
|
45
|
-
val: -32505857
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
desc: "1D Barcodes",
|
|
49
|
-
val: 2047
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
desc: "Aztec",
|
|
53
|
-
val: 268435456
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
desc: "QR Code",
|
|
57
|
-
val: 67108864
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
desc: "PDF417",
|
|
61
|
-
val: 33554432
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
desc: "DATAMATRIX",
|
|
65
|
-
val: 134217728
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
desc: "CODE_39",
|
|
69
|
-
val: 1
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
desc: "CODE_128",
|
|
73
|
-
val: 2
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
desc: "CODE_93",
|
|
77
|
-
val: 4
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
desc: "CODABAR",
|
|
81
|
-
val: 8
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
desc: "EAN_13",
|
|
85
|
-
val: 32
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
desc: "EAN_8",
|
|
89
|
-
val: 64
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
desc: "UPC_A",
|
|
93
|
-
val: 128
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
desc: "UPC_E",
|
|
97
|
-
val: 256
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
desc: "Interleaved 2 of 5 (ITF)",
|
|
101
|
-
val: 16
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
desc: "Industrial 2 of 5",
|
|
105
|
-
val: 512
|
|
106
|
-
}
|
|
107
|
-
];
|
|
108
|
-
|
|
109
|
-
function Dynamsoft_OnReady() {
|
|
110
|
-
DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');
|
|
111
|
-
if (DWObject) {
|
|
112
|
-
for (var index = 0; index < BarcodeInfo.length; index++)
|
|
113
|
-
document.getElementById("barcodeformat").options.add(new Option(BarcodeInfo[index].desc, index));
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function AcquireImage() {
|
|
118
|
-
if (DWObject) {
|
|
119
|
-
DWObject.SelectSource(function () {
|
|
120
|
-
DWObject.OpenSource();
|
|
121
|
-
DWObject.AcquireImage(
|
|
122
|
-
{
|
|
123
|
-
IfShowUI: false,
|
|
124
|
-
PixelType: Dynamsoft.EnumDWT_PixelType.TWPT_RGB,
|
|
125
|
-
Resolution: 200,
|
|
126
|
-
IfDisableSourceAfterAcquire: true
|
|
127
|
-
},
|
|
128
|
-
function () {
|
|
129
|
-
console.log("Successful!");
|
|
130
|
-
},
|
|
131
|
-
function (settings, errCode, errString) {
|
|
132
|
-
alert(errString)
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
}, function () {
|
|
136
|
-
alert('SelectSource failed!');
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function LoadImages() {
|
|
142
|
-
if (DWObject) {
|
|
143
|
-
if (DWObject.Addon && DWObject.Addon.PDF) {
|
|
144
|
-
DWObject.Addon.PDF.SetResolution(300);
|
|
145
|
-
DWObject.Addon.PDF.SetConvertMode(EnumDWT_ConvertMode.CM_RENDERALL);
|
|
146
|
-
}
|
|
147
|
-
DWObject.LoadImageEx('', 5,
|
|
148
|
-
function () { },
|
|
149
|
-
function (errorCode, errorString) {
|
|
150
|
-
alert('Load Image:' + errorString);
|
|
151
|
-
}
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function LoadPDFs() {
|
|
157
|
-
if (DWObject) {
|
|
158
|
-
if (DWObject.Addon && DWObject.Addon.PDF) {
|
|
159
|
-
DWObject.Addon.PDF.SetResolution(300);
|
|
160
|
-
DWObject.Addon.PDF.SetConvertMode(EnumDWT_ConvertMode.CM_RENDERALL);
|
|
161
|
-
}
|
|
162
|
-
DWObject.LoadImageEx('', 4,
|
|
163
|
-
function () { },
|
|
164
|
-
function (errorCode, errorString) {
|
|
165
|
-
alert('Load Image:' + errorString);
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function ReadBarcode() {
|
|
172
|
-
if (DWObject) {
|
|
173
|
-
if (DWObject.HowManyImagesInBuffer == 0) {
|
|
174
|
-
alert("Please scan or load an image first.");
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
Dynamsoft.Lib.showMask();
|
|
178
|
-
DWObject.Addon.BarcodeReader.getRuntimeSettings()
|
|
179
|
-
.then(function (settings) {
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Setting up the barcode reader
|
|
183
|
-
*/
|
|
184
|
-
settings.barcodeFormatIds = BarcodeInfo[document.getElementById("barcodeformat").selectedIndex].val;
|
|
185
|
-
settings.expectedBarcodesCount = 512;
|
|
186
|
-
settings.scaleDownThreshold = 2147483647;
|
|
187
|
-
/** End of settings */
|
|
188
|
-
return DWObject.Addon.BarcodeReader.updateRuntimeSettings(settings);
|
|
189
|
-
})
|
|
190
|
-
.then(function (settings) {
|
|
191
|
-
return DWObject.Addon.BarcodeReader.decode(DWObject.CurrentImageIndexInBuffer);
|
|
192
|
-
})
|
|
193
|
-
.then(function (results) {
|
|
194
|
-
var _now = new Date().toLocaleTimeString() + "<br />";
|
|
195
|
-
var objDiv = document.getElementById('divNoteMessage');
|
|
196
|
-
objDiv.innerHTML += _now;
|
|
197
|
-
if (results.length == 0) {
|
|
198
|
-
objDiv.innerHTML += "Nothing Found!<br />";
|
|
199
|
-
} else {
|
|
200
|
-
objDiv.innerHTML +=
|
|
201
|
-
"<p style='color: #fe8e14'>Barcode Found!!</p>";
|
|
202
|
-
barcodeText = [];
|
|
203
|
-
for (i = 0; i < results.length; i++) {
|
|
204
|
-
var result = results[i];
|
|
205
|
-
Barcode_text = result.BarcodeText;
|
|
206
|
-
var loc = result.LocalizationResult;
|
|
207
|
-
var x = loc.x1;
|
|
208
|
-
var y = loc.y1;
|
|
209
|
-
var format = result.BarcodeFormatString;
|
|
210
|
-
barcodeText.push("barcode[" + (i + 1) + "]: " + "<br />");
|
|
211
|
-
barcodeText.push("<strong>" + Barcode_text + "</strong>");
|
|
212
|
-
barcodeText.push("<br />format:" + format + "<br />");
|
|
213
|
-
barcodeText.push("x:" + x + "y:" + y + "<br />");
|
|
214
|
-
barcodeText.push("------------------------------<br />");
|
|
215
|
-
}
|
|
216
|
-
barcodeText.splice(0, 0, '<p style="padding:5px; margin:0;">');
|
|
217
|
-
barcodeText.push('</p>');
|
|
218
|
-
objDiv.innerHTML += barcodeText.join('');
|
|
219
|
-
}
|
|
220
|
-
objDiv.scrollTop = objDiv.scrollHeight;
|
|
221
|
-
Dynamsoft.Lib.hideMask()
|
|
222
|
-
}, function (ex) {
|
|
223
|
-
alert(ex);
|
|
224
|
-
Dynamsoft.Lib.hideMask()
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
</script>
|
|
229
|
-
</body>
|
|
230
|
-
|
|
231
|
-
</html>
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<title>Acquire Images</title>
|
|
6
|
-
<script src="../dist/dynamsoft.webtwain.min.js"></script>
|
|
7
|
-
</head>
|
|
8
|
-
|
|
9
|
-
<body style="padding: 30px;">
|
|
10
|
-
<div id="notMobile">
|
|
11
|
-
<h1>Acquire Images</h1>
|
|
12
|
-
<label style="font-size: x-large;" id="H5CameraLabel"><input type="checkbox" id="H5Camera" />Use H5
|
|
13
|
-
Camera</label>
|
|
14
|
-
<select style="font-size: x-large;" id="source"></select><br />
|
|
15
|
-
<input type="button" id="btn-switch" style="font-size: x-large;" value="Hide Video" onclick="SwitchViews();" />
|
|
16
|
-
<input type="button" id="btn-grab" style="font-size: x-large;" value="Acquire" onclick="CaptureImage();" />
|
|
17
|
-
<br />
|
|
18
|
-
<br />
|
|
19
|
-
<div id="dwtcontrolContainer"></div>
|
|
20
|
-
</div>
|
|
21
|
-
<script type="text/javascript">
|
|
22
|
-
Dynamsoft.WebTwainEnv.ResourcesPath = "../dist";
|
|
23
|
-
Dynamsoft.WebTwainEnv.ProductKey = 't00911wAAADwPAaIxHA38XfQgvv+o7wY1qFx4aAL6m5W9nK9ulevyXbe4DIRCPw4FUKWxOQpvvGnefCmnCtBu/1TALNmgEBeWrEAOcP/Asw44TCBWNwip6r+8VPorfA==';
|
|
24
|
-
Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady);
|
|
25
|
-
Dynamsoft.WebTwainEnv.Containers = [{ ContainerId: 'dwtcontrolContainer', Width: 600, Height: 800 }];
|
|
26
|
-
var bWASMCamera = true, bWASM = false;
|
|
27
|
-
window.onload = function () {
|
|
28
|
-
if (Dynamsoft.Lib.env.bMobile || Dynamsoft.WebTwainEnv.UseLocalService === false) {
|
|
29
|
-
Dynamsoft.WebTwainEnv.UseLocalService = false;
|
|
30
|
-
document.getElementById("H5CameraLabel").style.display = "none";
|
|
31
|
-
bWASM = true;
|
|
32
|
-
}
|
|
33
|
-
document.getElementById("H5Camera").onchange = function () {
|
|
34
|
-
sourceChanged(true);
|
|
35
|
-
bWASMCamera = document.getElementById("H5Camera").checked;
|
|
36
|
-
updateSources();
|
|
37
|
-
};
|
|
38
|
-
document.getElementById('source').onchange = function () {
|
|
39
|
-
sourceChanged();
|
|
40
|
-
}
|
|
41
|
-
if (Dynamsoft && Dynamsoft.Lib.env.bWin && Dynamsoft.WebTwainEnv.UseLocalService && !document.getElementById("H5Camera").checked) {
|
|
42
|
-
bWASMCamera = false;
|
|
43
|
-
}
|
|
44
|
-
Dynamsoft.WebTwainEnv.Load();
|
|
45
|
-
};
|
|
46
|
-
var DWObject;
|
|
47
|
-
var webCamStartingIndex;
|
|
48
|
-
var isVideoOn = true;
|
|
49
|
-
var devices = [];
|
|
50
|
-
|
|
51
|
-
function Dynamsoft_OnReady() {
|
|
52
|
-
DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');
|
|
53
|
-
updateSources();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function sourceChanged(closeCamera) {
|
|
57
|
-
if (closeCamera || document.getElementById('source').selectedIndex < webCamStartingIndex) {
|
|
58
|
-
if (bWASMCamera)
|
|
59
|
-
DWObject.Addon.Camera.stop();
|
|
60
|
-
else
|
|
61
|
-
DWObject.Addon.Webcam.StopVideo();
|
|
62
|
-
isVideoOn = false;
|
|
63
|
-
document.getElementById("btn-grab").style.backgroundColor = "";
|
|
64
|
-
document.getElementById('btn-grab').value = 'Acquire From a Scanner';
|
|
65
|
-
document.getElementById("btn-switch").style.display = 'none';
|
|
66
|
-
} else {
|
|
67
|
-
if (bWASMCamera)
|
|
68
|
-
DWObject.Addon.Camera.selectSource(devices[document
|
|
69
|
-
.getElementById("source").selectedIndex].deviceId);
|
|
70
|
-
else
|
|
71
|
-
DWObject.Addon.Webcam.SelectSource(devices[document
|
|
72
|
-
.getElementById("source").selectedIndex].label);
|
|
73
|
-
SetIfWebcamPlayVideo(true);
|
|
74
|
-
document.getElementById('btn-grab').value = 'Acquire From a Camera';
|
|
75
|
-
document.getElementById("btn-switch").style.display = '';
|
|
76
|
-
}
|
|
77
|
-
document.getElementById("btn-grab").disabled = "";
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function showSources() {
|
|
81
|
-
var sourceElement = document.getElementById("source");
|
|
82
|
-
var i, L = sourceElement.options.length - 1;
|
|
83
|
-
for (i = L; i >= 0; i--) {
|
|
84
|
-
sourceElement.remove(i);
|
|
85
|
-
}
|
|
86
|
-
for (var i = 0; i < devices.length; i++)
|
|
87
|
-
sourceElement.options.add(new Option(devices[i].label), i);
|
|
88
|
-
sourceChanged();
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function updateSources() {
|
|
92
|
-
devices = [];
|
|
93
|
-
if (DWObject) {
|
|
94
|
-
if (bWASM) {
|
|
95
|
-
webCamStartingIndex = 0;
|
|
96
|
-
DWObject.Addon.Camera.getSourceList().then(function (list) {
|
|
97
|
-
devices = list;
|
|
98
|
-
showSources();
|
|
99
|
-
});
|
|
100
|
-
} else {
|
|
101
|
-
var i = 0, scanners = DWObject.GetSourceNames();
|
|
102
|
-
for (i = 0; i < scanners.length; i++) {
|
|
103
|
-
devices.push({
|
|
104
|
-
deviceId: i,
|
|
105
|
-
label: scanners[i]
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
webCamStartingIndex = i;
|
|
109
|
-
if (bWASMCamera) {
|
|
110
|
-
DWObject.Addon.Camera.getSourceList().then(function (list) {
|
|
111
|
-
devices = devices.concat(list);
|
|
112
|
-
showSources();
|
|
113
|
-
});
|
|
114
|
-
} else {
|
|
115
|
-
var cameras = DWObject.Addon.Webcam.GetSourceList();
|
|
116
|
-
for (i = 0; i < cameras.length; i++) {
|
|
117
|
-
devices.push({
|
|
118
|
-
deviceId: webCamStartingIndex + i,
|
|
119
|
-
label: cameras[i]
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
showSources();
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function SetIfWebcamPlayVideo(bShow) {
|
|
129
|
-
if (bShow) {
|
|
130
|
-
if (!bWASMCamera)
|
|
131
|
-
DWObject.Addon.Webcam.StopVideo();
|
|
132
|
-
setTimeout(function () {
|
|
133
|
-
if (bWASMCamera)
|
|
134
|
-
DWObject.Addon.Camera.play();
|
|
135
|
-
else
|
|
136
|
-
DWObject.Addon.Webcam.PlayVideo(DWObject, 80, function () { });
|
|
137
|
-
isVideoOn = true;
|
|
138
|
-
document.getElementById("btn-grab").style.backgroundColor = "";
|
|
139
|
-
document.getElementById("btn-grab").disabled = "";
|
|
140
|
-
document.getElementById("btn-switch").value = "Hide Video";
|
|
141
|
-
}, 30);
|
|
142
|
-
} else {
|
|
143
|
-
if (bWASMCamera)
|
|
144
|
-
DWObject.Addon.Camera.stop();
|
|
145
|
-
else
|
|
146
|
-
DWObject.Addon.Webcam.StopVideo();
|
|
147
|
-
isVideoOn = false;
|
|
148
|
-
document.getElementById("btn-grab").style.backgroundColor = "#aaa";
|
|
149
|
-
document.getElementById("btn-grab").disabled = "disabled";
|
|
150
|
-
document.getElementById("btn-switch").value = "Show Video";
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function SwitchViews() {
|
|
155
|
-
if (isVideoOn == false) {
|
|
156
|
-
// continue the video
|
|
157
|
-
SetIfWebcamPlayVideo(true);
|
|
158
|
-
} else {
|
|
159
|
-
// stop the video
|
|
160
|
-
SetIfWebcamPlayVideo(false);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function CaptureImage() {
|
|
165
|
-
if (DWObject) {
|
|
166
|
-
if (document.getElementById('source').selectedIndex < webCamStartingIndex) {
|
|
167
|
-
DWObject.IfShowUI = true;
|
|
168
|
-
DWObject.IfDisableSourceAfterAcquire = true;
|
|
169
|
-
DWObject.SelectSourceByIndex(document.getElementById('source').selectedIndex);
|
|
170
|
-
DWObject.CloseSource();
|
|
171
|
-
DWObject.OpenSource();
|
|
172
|
-
DWObject.AcquireImage();
|
|
173
|
-
} else {
|
|
174
|
-
var funCaptureImage = function () {
|
|
175
|
-
setTimeout(function () {
|
|
176
|
-
SetIfWebcamPlayVideo(false);
|
|
177
|
-
}, 50);
|
|
178
|
-
};
|
|
179
|
-
if (bWASMCamera)
|
|
180
|
-
DWObject.Addon.Camera.capture().then(function (blob) { DWObject.Viewer.render(); funCaptureImage(); });
|
|
181
|
-
else
|
|
182
|
-
DWObject.Addon.Webcam.CaptureImage(funCaptureImage, funCaptureImage);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
</script>
|
|
187
|
-
</body>
|
|
188
|
-
|
|
189
|
-
</html>
|