Skip to content

Latest commit

 

History

History
111 lines (78 loc) · 2.65 KB

linedrawingitem-v4.0.1.md

File metadata and controls

111 lines (78 loc) · 2.65 KB
layout title description keywords needAutoGenerateSidebar needGenerateH3Content noTitleIndex breadcrumbText
default-layout
LineDrawingItem - Dynamsoft Camera Enhancer JavaScript API
This page shows the LineDrawingItem definitions of Dynamsoft Camera Enhancer JavaScript SDK.
camera enhancer, linedrawingitem, javascript, js
true
true
true
LineDrawingItem

Class LineDrawingItem

The LineDrawingItem class extends the functionality of the DrawingItem class and is specifically tailored to handle line-related drawing operations.

Name Description
constructor LineDrawingItem() Constructor for the class.
getLine() Retrieves the current line being used for drawing.
setLine() Sets the line to be used for drawing.

LineDrawingItem

Constructor for the class.

constructor(
    line: LineSegment,
    drawingStyleId?: number
)

Parameters

line: the line to be drawn, of type LineSegment.

drawingStyleId: [Optional] the unique ID of the DrawingStyle to apply to this DrawingItem.

Code Snippet

let cameraView = cameraEnhancer.getCameraView();
let drawingLayer = cameraView.createDrawingLayer();
let lineItem = new Dynamsoft.DCE.DrawingItem.LineDrawingItem(
    {
        startPoint:
        {
            x: 50, 
            y: 50
        }, 
        endPoint:
        {
            x: 500, 
            y: 500
        }
    }
);
drawingLayer.addDrawingItem(lineItem);

See also

LineSegment

getLine

Retrieves the current line being used for drawing.

getLine(): LineSegment;

Parameters

None.

Return Value

The current line being used for drawing, of type LineSegment.

Code Snippet

lineItem.getLine();

setLine

Sets the line to be used for drawing. This method allows changing the line after the object has been instantiated.

setLine(line: LineSegment): void;

Parameters

line: the line to be drawn, of type LineSegment.

Return Value

None.

Code Snippet

lineItem.setLine(/*A-New-Line*/);

See also

LineSegment