@@ -23,21 +23,21 @@ ng new my-app
2323
2424``` cmd
2525cd my-app
26- npm install @dynamsoft/ dynamsoft-core
27- npm install @dynamsoft/ dynamsoft-license
26+ npm install dynamsoft-core
27+ npm install dynamsoft-license
2828npm install @dynamsoft/dynamsoft-utility
2929npm install @dynamsoft/dynamsoft-barcode-reader
30- npm install @dynamsoft/ dynamsoft-capture-vision-router
31- npm install @dynamsoft/ dynamsoft-camera-enhancer
30+ npm install dynamsoft-capture-vision-router
31+ npm install dynamsoft-camera-enhancer
3232```
3333
3434## Start to implement
3535
3636### Add file "cvr.ts" under "/src/" to configure libraries
3737
3838``` typescript
39- import { CoreModule } from ' @dynamsoft/ dynamsoft-core' ;
40- import { LicenseManager } from ' @dynamsoft/ dynamsoft-license' ;
39+ import { CoreModule } from ' dynamsoft-core' ;
40+ import { LicenseManager } from ' dynamsoft-license' ;
4141import ' @dynamsoft/dynamsoft-barcode-reader' ;
4242
4343/** LICENSE ALERT - README
@@ -56,13 +56,13 @@ LicenseManager.initLicense(
5656 */
5757
5858CoreModule .engineResourcePaths = {
59- std:
" https://npm.scannerproxy.com/cdn/@ dynamsoft/dynamsoft [email protected] -dev-20231222202916 /dist/" ,
60- dip:
" https://npm.scannerproxy.com/cdn/@ dynamsoft/dynamsoft [email protected] -dev-20231219135109 /dist/" ,
61- core:
" https://npm.scannerproxy.com/cdn/@ dynamsoft/dynamsoft [email protected] .20-dev-20231222181259 /dist/" ,
62- license:
" https://npm.scannerproxy.com/cdn/@ dynamsoft/dynamsoft [email protected] .0-dev-20231222153411 /dist/" ,
63- cvr:
" https://npm.scannerproxy.com/cdn/@ dynamsoft/dynamsoft [email protected] .20-dev-20231222144235 /dist/" ,
64- dbr:
" https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20231222153407 /dist/" ,
65- dce:
" https://npm.scannerproxy.com/cdn/@ dynamsoft/dynamsoft [email protected] -dev-20231222174818 /dist/" 59+ std:
" https://cdn.jsdelivr.net/npm/ [email protected] /dist/" ,
60+ dip:
" https://cdn.jsdelivr.net/npm/ [email protected] /dist/" ,
61+ core:
" https://cdn.jsdelivr.net/npm/ [email protected] .30 /dist/" ,
62+ license:
" https://cdn.jsdelivr.net/npm/ [email protected] .20 /dist/" ,
63+ cvr:
" https://cdn.jsdelivr.net/npm/ [email protected] .30 /dist/" ,
64+ dbr:
" https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected] 20240115142402 /dist/" ,
65+ dce:
" https://cdn.jsdelivr.net/npm/ [email protected] /dist/" 6666};
6767
6868// Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading.
@@ -104,6 +104,9 @@ ng generate component hello-world
104104
105105``` html
106106<div #uiContainer class =" div-ui-container" ></div >
107+ Results:
108+ <br >
109+ <div #resultsContainer id =" div-results-container" ></div >
107110```
108111
109112* Add CSS style in ` video-capture.component.css ` .
@@ -113,22 +116,28 @@ ng generate component hello-world
113116 width : 100% ;
114117 height : 70vh ;
115118}
119+
120+ .div-results-container {
121+ width : 100% ;
122+ height : 10vh ;
123+ overflow : auto ;
124+ }
116125```
117126
118127* In ` video-capture.component.ts ` , add code for initializing and destroying some instances.
119128
120129``` typescript
121130import { Component , ElementRef , ViewChild } from ' @angular/core' ;
122- import { EnumCapturedResultItemType } from ' @dynamsoft/ dynamsoft-core'
131+ import { EnumCapturedResultItemType } from ' dynamsoft-core'
123132import { DecodedBarcodesResult } from ' @dynamsoft/dynamsoft-barcode-reader' ;
124133import {
125134 CameraEnhancer ,
126135 CameraView ,
127- } from ' @dynamsoft/ dynamsoft-camera-enhancer' ;
136+ } from ' dynamsoft-camera-enhancer' ;
128137import {
129138 CapturedResultReceiver ,
130139 CaptureVisionRouter ,
131- } from ' @dynamsoft/ dynamsoft-capture-vision-router' ;
140+ } from ' dynamsoft-capture-vision-router' ;
132141import { MultiFrameResultCrossFilter } from ' @dynamsoft/dynamsoft-utility' ;
133142
134143@Component ({
@@ -145,6 +154,8 @@ export class VideoCaptureComponent {
145154
146155 @ViewChild (' uiContainer' ) uiContainer: ElementRef <HTMLDivElement > | null =
147156 null ;
157+ @ViewChild (' resultsContainer' ) resultsContainer: ElementRef <HTMLDivElement > | null =
158+ null ;
148159
149160 async init(): Promise <{
150161 cameraView: CameraView ;
@@ -164,9 +175,12 @@ export class VideoCaptureComponent {
164175 // Define a callback for results.
165176 const resultReceiver = new CapturedResultReceiver ();
166177 resultReceiver .onDecodedBarcodesReceived = (result : DecodedBarcodesResult ) => {
178+ if (! result .barcodesResultItems .length ) return ;
179+
180+ this .resultsContainer ! .nativeElement .innerHTML = " " ;
181+ console .log (result );
167182 for (let item of result .barcodesResultItems ) {
168- console .log (item .text );
169- alert (item .text );
183+ this .resultsContainer ! .nativeElement .innerHTML += ` ${item .formatString }: ${item .text }<br><hr> ` ;
170184 }
171185 };
172186 router .addResultReceiver (resultReceiver );
@@ -252,7 +266,7 @@ export class VideoCaptureComponent {
252266``` typescript
253267import { Component } from ' @angular/core' ;
254268import { BarcodeResultItem } from ' @dynamsoft/dynamsoft-barcode-reader' ;
255- import { CaptureVisionRouter } from ' @dynamsoft/ dynamsoft-capture-vision-router' ;
269+ import { CaptureVisionRouter } from ' dynamsoft-capture-vision-router' ;
256270
257271@Component ({
258272 selector: ' app-image-capture' ,
0 commit comments