Skip to content

Commit 188da39

Browse files
authored
Merge pull request #159 from Dynamsoft/_dev
Dev
2 parents c6236d0 + 8f3b895 commit 188da39

File tree

113 files changed

+1824
-1740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1824
-1740
lines changed

hello-world/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The Hello World Sample Set
22

3-
As you have already gone through the [user guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=10.0.21#getting-started---hello-world), you may have come across some basic "Hello World" code that can help you create a simple web application using our SDK quickly.
3+
As you have already gone through the [user guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=10.2.10#getting-started---hello-world), you may have come across some basic "Hello World" code that can help you create a simple web application using our SDK quickly.
44

55
In this set of samples, we will revisit the "Hello World" code and show how to implement it using some popular frameworks, such as Angular, React, and Vue.
66

hello-world/angular/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ LicenseManager.initLicense(
5151
/**
5252
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
5353
* Note that if you downloaded this sample from Dynamsoft while logged in, the above license key may already be your own 30-day trial license.
54-
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=10.0.21&utm_source=github#specify-the-license or contact [email protected].
54+
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=10.2.10&utm_source=github#specify-the-license or contact [email protected].
5555
* LICENSE ALERT - THE END
5656
*/
5757

5858
CoreModule.engineResourcePaths = {
59-
std: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.0.0/dist/",
60-
dip: "https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.0.30/dist/",
61-
core: "https://cdn.jsdelivr.net/npm/dynamsoft-core@3.0.33/dist/",
62-
license: "https://cdn.jsdelivr.net/npm/dynamsoft-license@3.0.40/dist/",
63-
cvr: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.0.32/dist/",
64-
dbr: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@10.0.21/dist/",
65-
dce: "https://cdn.jsdelivr.net/npm/[email protected].1/dist/"
59+
std: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.2.0/dist/",
60+
dip: "https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.2.10/dist/",
61+
core: "https://cdn.jsdelivr.net/npm/dynamsoft-core@3.2.10/dist/",
62+
license: "https://cdn.jsdelivr.net/npm/dynamsoft-license@3.2.10/dist/",
63+
cvr: "https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-router@2.2.10/dist/",
64+
dbr: "https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader@10.2.10/dist/",
65+
dce: "https://cdn.jsdelivr.net/npm/[email protected].2/dist/"
6666
};
6767

6868
// Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading.
@@ -183,16 +183,16 @@ export class VideoCaptureComponent {
183183
// Filter out unchecked and duplicate results.
184184
const filter = new MultiFrameResultCrossFilter();
185185
filter.enableResultCrossVerification(
186-
EnumCapturedResultItemType.CRIT_BARCODE,
186+
"barcode",
187187
true
188188
); // Filter out unchecked barcodes.
189189
// Filter out duplicate barcodes within 3 seconds.
190190
filter.enableResultDeduplication(
191-
EnumCapturedResultItemType.CRIT_BARCODE,
191+
"barcode",
192192
true
193193
);
194194
filter.setDuplicateForgetTime(
195-
EnumCapturedResultItemType.CRIT_BARCODE,
195+
"barcode",
196196
3000
197197
);
198198
await router.addResultFilter(filter);

hello-world/angular/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "hello-world",
2+
"name": "dbrjs-sample-angular",
33
"version": "0.0.0",
44
"scripts": {
55
"ng": "ng",
@@ -18,12 +18,12 @@
1818
"@angular/platform-browser": "^16.2.0",
1919
"@angular/platform-browser-dynamic": "^16.2.0",
2020
"@angular/router": "^16.2.0",
21-
"dynamsoft-barcode-reader": "10.0.21",
22-
"dynamsoft-utility": "1.0.21",
23-
"dynamsoft-camera-enhancer": "4.0.1",
24-
"dynamsoft-capture-vision-router": "2.0.32",
25-
"dynamsoft-core": "3.0.33",
26-
"dynamsoft-license": "3.0.40",
21+
"dynamsoft-barcode-reader": "10.2.10",
22+
"dynamsoft-utility": "1.2.10",
23+
"dynamsoft-camera-enhancer": "4.0.2",
24+
"dynamsoft-capture-vision-router": "2.2.10",
25+
"dynamsoft-core": "3.2.10",
26+
"dynamsoft-license": "3.2.10",
2727
"rxjs": "~7.8.0",
2828
"tslib": "^2.3.0",
2929
"zone.js": "~0.13.0"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.title {
2+
display: flex;
3+
justify-content: center;
4+
align-items: center;
5+
margin-top: 50px;
6+
}
7+
.title .title-logo {
8+
width: 30px;
9+
height: 30px;
10+
margin-left: 10px;
11+
}
12+
13+
.top-btns {
14+
width: 30%;
15+
margin: 20px auto;
16+
}
17+
18+
.top-btns button {
19+
display: inline-block;
20+
border: 1px solid black;
21+
padding: 5px 15px;
22+
background-color: transparent;
23+
cursor: pointer;
24+
}
25+
26+
.top-btns button:first-child {
27+
border-top-left-radius: 10px;
28+
border-bottom-left-radius: 10px;
29+
border-right: transparent;
30+
}
31+
.top-btns button:nth-child(2) {
32+
border-top-right-radius: 10px;
33+
border-bottom-right-radius: 10px;
34+
border-left: transparent;
35+
}
36+
37+
@media screen and (max-width: 500px) {
38+
.top-btns {
39+
width: 70%;
40+
}
41+
}
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
<app-hello-world></app-hello-world>
1+
<div class='App'>
2+
<div class='title'>
3+
<h2 class='title-text'>Hello World for Angular</h2>
4+
<img class='title-logo' src="./assets/logo.svg" alt="logo" />
5+
</div>
6+
<div class='top-btns'>
7+
<button (click)="switchMode('video')" [ngStyle]="{'background-color': mode === 'video' ? 'rgb(255,174,55)' : 'white'}">Video Capture</button>
8+
<button (click)="switchMode('image')" [ngStyle]="{'background-color': mode === 'image' ? 'rgb(255,174,55)' : 'white'}">Image Capture</button>
9+
</div>
10+
<app-video-capture *ngIf="mode === 'video'"></app-video-capture>
11+
<app-image-capture *ngIf="mode === 'image'"></app-image-capture>
12+
</div>

hello-world/angular/src/app/app.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@ import { Component } from '@angular/core';
66
styleUrls: ['./app.component.css']
77
})
88
export class AppComponent {
9-
title = 'angular';
9+
title = 'my-app';
10+
11+
mode: string = "video";
12+
13+
switchMode(value: string) {
14+
this.mode = value;
15+
}
1016
}

hello-world/angular/src/app/app.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ import { NgModule } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
33

44
import { AppComponent } from './app.component';
5-
import { HelloWorldComponent } from './hello-world/hello-world.component';
65
import { ImageCaptureComponent } from './image-capture/image-capture.component';
76
import { VideoCaptureComponent } from './video-capture/video-capture.component';
87

98
@NgModule({
109
declarations: [
1110
AppComponent,
12-
HelloWorldComponent,
1311
ImageCaptureComponent,
1412
VideoCaptureComponent
1513
],

hello-world/angular/src/app/hello-world/hello-world.component.css

Lines changed: 0 additions & 27 deletions
This file was deleted.

hello-world/angular/src/app/hello-world/hello-world.component.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

hello-world/angular/src/app/hello-world/hello-world.component.spec.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)