---
layout: default-layout
title: class CRect - Dynamsoft Core Module C++ Edition API Reference
description: API reference for the CRect class in Dynamsoft Core C++ Edition, representing an axis-aligned rectangle with top, left, right, and bottom coordinates.
keywords: rect, c++
needAutoGenerateSidebar: true
---

# CRect

The `CRect` class represents a rectangle in 2D space. It contains four integer values that specify the top, left, right, and bottom edges of the rectangle.

## Definition

*Namespace:* dynamsoft::basic_structures

*Assembly:* DynamsoftCore

```cpp
class CRect 
```

## Attributes Summary

| Attribute | Type |
|---------- | ---- |
| [`top`](#top) | *int* |
| [`left`](#left) | *int* |
| [`right`](#right) | *int* |
| [`bottom`](#bottom) | *int* |
| [`id`](#id) | *int* |

### top

The top edge of the rectangle.

```cpp
int top
```

### left

The left edge of the rectangle.

```cpp
int left
```

### right

The right edge of the rectangle.

```cpp
int right
```

### bottom

The bottom edge of the rectangle.

```cpp
int bottom
```

### id

The id of the rectangle.

```cpp
int id
```