Skip to content

Latest commit

 

History

History
105 lines (72 loc) · 2.56 KB

rectdrawingitem-v4.0.1.md

File metadata and controls

105 lines (72 loc) · 2.56 KB
layout title description keywords needAutoGenerateSidebar needGenerateH3Content noTitleIndex breadcrumbText
default-layout
RectDrawingItem - Dynamsoft Camera Enhancer JavaScript API
This page shows the RectDrawingItem definitions of Dynamsoft Camera Enhancer JavaScript SDK.
camera enhancer, rectdrawingitem, javascript, js
true
true
true
RectDrawingItem

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.DrawingItem.RectDrawingItem(
    {
        x: 50,
        y: 50,
        width: 500,
        height: 500
    }
);
drawingLayer.addDrawingItem(rectItem);

See also

Rect

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

Rect