Resource Base
Table of contents

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

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

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version(4.0.2)
  • Version 4.x
    • Version 4.0.1
    • Version 4.0.0
  • Version 3.x
    • Version 3.3.10
    • Version 3.3.9
    • Version 3.3.8
    • Version 3.3.7
    • Version 3.3.6
    • Version 3.3.5
    • Version 3.3.4
    • Version 3.3.3
    • Version 3.3.2
    • Version 3.3.1
    • Version 3.3.0
    • Version 3.2.0
    • Version 3.1.0
    • Version 3.0.1
    • Version 3.0.0
  • Version 2.x
    • Version 2.3.5
    • Version 2.3.2
    • Version 2.3.1
    • Version 2.3.0
    • Version 2.1.4
    • Version 2.1.3
    • Version 2.1.0
    • Version 2.0.0
Change +