Skip to content

Commit efc4cf5

Browse files
Merge branch 'main' into preview
2 parents 3840b06 + 34e13c3 commit efc4cf5

File tree

1 file changed

+5
-5
lines changed
  • programming/javascript/user-guide

1 file changed

+5
-5
lines changed

programming/javascript/user-guide/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ The complete code of the "Hello World" example is shown below
115115
cvRouter.setInput(cameraEnhancer);
116116
117117
const resultsContainer = document.querySelector("#results");
118-
cvRouter.addResultReceiver({ onCapturedResultReceived: (result) => {
118+
cvRouter.addResultReceiver({ onDecodedBarcodesReceived: (result) => {
119119
if (result.barcodeResultItems?.length) {
120120
resultsContainer.textContent = '';
121121
for (let item of result.barcodeResultItems) {
@@ -397,13 +397,13 @@ cvRouter.setInput(cameraEnhancer);
397397
398398
### Step 4: Register a result receiver
399399
400-
Once the image processing is complete, the results are sent to all the registered `CapturedResultReceiver` objects. Each `CapturedResultReceiver` object may encompass one or multiple callback functions associated with various result types. This time we use `onCapturedResultReceived`:
400+
Once the image processing is complete, the results are sent to all the registered `CapturedResultReceiver` objects. Each `CapturedResultReceiver` object may encompass one or multiple callback functions associated with various result types. This time we use `onDecodedBarcodesReceived`:
401401
<!--In our particular case, our focus is on identifying barcodes within the images, so it's sufficient to define the callback function `onDecodedBarcodesReceived`:-->
402402
403403
```javascript
404404
const resultsContainer = document.querySelector("#results");
405405
const resultReceiver = new Dynamsoft.CVR.CapturedResultReceiver();
406-
resultReceiver.onCapturedResultReceived = (result) => {
406+
resultReceiver.onDecodedBarcodesReceived = (result) => {
407407
if (result.barcodeResultItems?.length) {
408408
resultsContainer.textContent = '';
409409
for (let item of result.barcodeResultItems) {
@@ -419,7 +419,7 @@ You can also write code like this. It is the same.
419419
420420
```javascript
421421
const resultsContainer = document.querySelector("#results");
422-
cvRouter.addResultReceiver({ onCapturedResultReceived: (result) => {
422+
cvRouter.addResultReceiver({ onDecodedBarcodesReceived: (result) => {
423423
if (result.barcodeResultItems?.length) {
424424
resultsContainer.textContent = '';
425425
for (let item of result.barcodeResultItems) {
@@ -505,7 +505,7 @@ Please be aware that it is necessary to update the `CapturedResultReceiver` obje
505505
506506
```javascript
507507
const EnumCRIT = Dynamsoft.Core.EnumCapturedResultItemType;
508-
resultReceiver.onCapturedResultReceived = (result) => {
508+
resultReceiver.onDecodedBarcodesReceived = (result) => {
509509
if (result.barcodeResultItems?.length) {
510510
// Use a filter to get the image on which barcodes are found.
511511
let image = result.items.filter(

0 commit comments

Comments
 (0)