# RectDrawingItem

The `RectDrawingItem` class is a subclass of `DrawingItem` that represents a rectangular drawing item.

## Definition

*Assembly:* DynamsoftCaptureVisionBundle.aar

*Namespace:* com.dynamsoft.dce

```java
class RectDrawingItem extends DrawingItem
```

## Methods

| Method | Description |
|------- |-------------|
| [`getRect`](#getrect) | Get the rect information of the `RectDrawingItem`. |
| [`getMediaType`](#getmediatype) | Get the media type of the `DrawingItem`. |
| [`RectDrawingItem(rect)`](#rectdrawingitemrect) | Create an instance of `RectDrawingItem`. |
| [`RectDrawingItem(rect,coordinateBase)`](#rectdrawingitemrectcoordinatebase) | Create an instance of `RectDrawingItem`. |

## Inherited Methods

The following methods are inherited from the superclass [`DrawingItem`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md).

| Method | Description |
|------- |-------------|
| [`setDrawingStyleId`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md#setdrawingstyleid) | Set the `DrawingStyle` of the `DrawingItem`. If a `DrawingItem` holds a drawing style ID, it will not use the default style of its layer. |
| [`getDrawingStyleId`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md#getdrawingstyleid) | Get the DrawingStyle of the `DrawingItem`. |
| [`setState`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md#setstate) | Set the state of the `DrawingItem`. |
| [`getState`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md#getstate) | Get the state of the `DrawingItem`. |
| [`getCoordinateBase`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md#getcoordinatebase) | Get the coordinate base of the `DrawingItem`. The coordinate base is image by default. |
| [`getMediaType`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md#getmediatype) | Get the media type of the `DrawingItem`. |
| [`addNote`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md#addnote) | Add a note to the `DrawingItem`. |
| [`getNote`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md#getnote) | Get the specified `Note`. |
| [`hasNote`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md#hasnote) | Check whether the specified Note exists. |
| [`updateNote`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md#updatenote) | Update the content of the specified `Note`. |
| [`deleteNote`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md#deletenote) | Remove the specified `Note` with the specified name. |
| [`getAllNotes`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md#getallnotes) | Get all `Notes` of this DrawingItem. |
| [`clearNotes`](https://www.dynamsoft.com/camera-enhancer/docs/mobile/programming/android/auxiliary-api/drawingitem.md#clearnotes) | Remove all `Notes` of this DrawingItem. |

### getRect

Get the rect information of the `RectDrawingItem`.

```java
android.graphics.Rect getRect(){}
```

### getMediaType

Get the media type of the `DrawingItem`.

```java
EnumDrawingItemMediaType getMediaType;
```

### RectDrawingItem(rect)

Create an instance of `RectDrawingItem`.

```java
RectDrawingItem(android.graphics.Rect rect){}
```

**Parameters**

`rect`: A `android.graphics.Rect` object that stores the rect coordinates information.

**Return Value**

An instance of `RectDrawingItem`.

## RectDrawingItem(rect,coordinateBase)

Create an instance of `RectDrawingItem`.

```java
RectDrawingItem(android.graphics.Rect rect, EnumCoordinateBase coordinateBase){}
```

**Parameters**

`rect`: A `android.graphics.Rect` object that stores the rect coordinates information.  
`coordinateBase`: The coordinate base of the `DrawingItem`.

**Return Value**

An instance of `RectDrawingItem`.
