Skip to content

Commit f89c2ad

Browse files
Merge pull request #54 from dynamsoft-docs/preview
Fixed issues #50 & #51
2 parents 20686a4 + 75e0034 commit f89c2ad

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

programming/javascript/user-guide/features/draw-shapes.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ We will start with the following code which defines a page that has a CameraEnha
2828
<div id="enhancerUIContainer" style="width:100%; height:100%;"></div>
2929
<script>
3030
let cameraEnhancer = null;
31-
let view = null;
31+
let cameraView = null;
3232
document.getElementById('drawShapes').onclick = drawShapes;
3333
(async () => {
34-
view = await Dynamsoft.DCE.CameraView.createInstance();
35-
cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(view);
36-
document.getElementById("enhancerUIContainer").appendChild(view.getUIElement());
34+
cameraView = await Dynamsoft.DCE.CameraView.createInstance();
35+
cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView);
36+
document.getElementById("enhancerUIContainer").appendChild(cameraView.getUIElement());
3737
await cameraEnhancer.open();
3838
})();
3939
function drawShapes(){}
@@ -44,11 +44,11 @@ We will start with the following code which defines a page that has a CameraEnha
4444

4545
## Add a DrawingLayer
4646

47-
All shapes are drawn on specific [`DrawingLayer`](../../api-reference/drawinglayer.md)s. The first step in drawing a shape is to create a **DrawingLayer**.
47+
All shapes are drawn on specific [`DrawingLayer`](../../api-reference/drawinglayer.md)s. The first step in drawing a shape is to create a **DrawingLayer** on the viewer.
4848

4949
```javascript
5050
function drawShapes(){
51-
let drawingLayer = cameraEnhancer.createDrawingLayer();
51+
let drawingLayer = cameraView.createDrawingLayer();
5252
}
5353
```
5454

@@ -59,7 +59,7 @@ An `DrawingItem` is the basic shape that can be drawn. The SDK classify **Drawin
5959
The following code shows how to define these types of **DrawingItems**:
6060

6161
```javascript
62-
let drawingLayer = view.createDrawingLayer();
62+
let drawingLayer = cameraView.createDrawingLayer();
6363
let rect = new Dynamsoft.DCE.RectDrawingItem({x: 100,y: 100,width: 300,height: 300});
6464
let line = new Dynamsoft.DCE.LineDrawingItem({startPoint:{x: 600, y: 600}, endPoint:{x: 1050, y: 400}});
6565
let text = new Dynamsoft.DCE.TextDrawingItem("TESTING...",{x: 20,y: 20,width: 100,height: 100});
@@ -70,7 +70,7 @@ let img = new Dynamsoft.DCE.ImageDrawingItem(document.getElementById('testIMG'),
7070
7171
```javascript
7272
import { DrawingItem } from "dynamsoft-camera-enhancer";
73-
let drawingLayer = view.createDrawingLayer();
73+
let drawingLayer = cameraView.createDrawingLayer();
7474
let rect = new DrawingItem.RectDrawingItem({x: 100,y: 100,width: 300,height: 300});
7575
let line = new DrawingItem.LineDrawingItem({startPoint:{x: 600, y: 600}, endPoint:{x: 1050, y: 400}});
7676
let text = new DrawingItem.TextDrawingItem("TESTING...",{x: 20,y: 20,width: 100,height: 100});
@@ -88,12 +88,12 @@ After **DrawingItems** have been defined, simply call `addDrawingItems()` to dra
8888

8989
```javascript
9090
function drawShapes(){
91-
let drawingLayer = view.createDrawingLayer();
91+
let drawingLayer = cameraView.createDrawingLayer();
9292
let rect = new Dynamsoft.DCE.RectDrawingItem({x: 100,y: 100,width: 300,height: 300});
9393
let line = new Dynamsoft.DCE.LineDrawingItem({startPoint:{x: 600, y: 600}, endPoint:{x: 1050, y: 400}});
9494
let text = new Dynamsoft.DCE.TextDrawingItem("TESTING...",{x: 20,y: 20,width: 100,height: 100});
9595
let quad = new Dynamsoft.DCE.QuadDrawingItem({points:[{x:600,y:100},{x:500,y:300},{x:700,y:300},{x:700,y:100}]});
96-
let img = new Dynamsoft.DCE..ImageDrawingItem(document.getElementById('testIMG'),{x: 200,y: 200,width: 300,height: 300},true);
96+
let img = new Dynamsoft.DCE.ImageDrawingItem(document.getElementById('testIMG'),{x: 200,y: 200,width: 300,height: 300},true);
9797
drawingLayer.addDrawingItems([rect,line,text,quad,img]);
9898
}
9999
```

0 commit comments

Comments
 (0)