Class RectDrawingItem
The RectDrawingItem
class extends the functionality of the DrawingItem
class and is specifically tailored to handle rectangle-related drawing operations.
Name | Description |
---|---|
constructor RectDrawingItem() |
Constructor for the class. |
getRect() | Retrieves the current rectangle being used for drawing. |
setRect() | Sets the rectangle to be used for drawing. |
RectDrawingItem
Constructor for the class.
constructor(
rect: Rect,
drawingStyleId?: number
)
Parameters
rect
: the rectangle to be drawn, of type Rect
.
drawingStyleId
: [Optional] the unique ID of the DrawingStyle
to apply to this DrawingItem
.
Code Snippet
let cameraView = cameraEnhancer.getCameraView();
let drawingLayer = cameraView.createDrawingLayer();
let rectItem = new Dynamsoft.DCE.RectDrawingItem(
{
x: 50,
y: 50,
width: 500,
height: 500
}
);
drawingLayer.addDrawingItem(rectItem);
See also
getRect
Retrieves the current rectangle being used for drawing.
getRect(): Rect;
Parameters
None.
Return Value
The current rectangle being used for drawing, of type Rect
.
Code Snippet
rectItem.getRect();
setRect
Sets the rectangle to be used for drawing. This method allows changing the rectangle after the object has been instantiated.
setRect(rect: Rect): void;
Parameters
rect
: the rectangle to be drawn, of type Rect
.
Return Value
None.
Code Snippet
rectItem.setRect(/*A-New-Rectangle*/);
See also