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
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