# OdfRect

Position and size expressed as ODF lengths.

Struct 

`OfficeIMO.OpenDocument`

**Namespace**

`OfficeIMO.OpenDocument`

**Assembly**

`OfficeIMO.OpenDocument`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[OdfRect.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfRect.cs#L7)

**Base**

`ValueType`

**Modifiers**

sealed

Position and size expressed as ODF lengths.

## Inheritance

- ValueType
- OdfRect

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Create and Read ODT, ODS and ODP Files](/docs/open-document/create-read/) Guide
  
  Create OpenDocument text, spreadsheet and presentation files, read their content, edit them in place, and open password-protected files.

## Usage

Explore 30 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 12

- Method [OdfRect.FromCentimeters](/api/open-document/officeimo-opendocument-odfrect/#method-fromcentimeters-double-double-double-double)
- Property [OdfShape.Bounds](/api/open-document/officeimo-opendocument-odfshape/#property-bounds)
- Property [OdgShape.Bounds](/api/open-document/officeimo-opendocument-odgshape/#property-bounds)
- Property [OdpEllipse.Bounds](/api/open-document/officeimo-opendocument-odpellipse/#property-bounds)
- Property [OdpGroup.Bounds](/api/open-document/officeimo-opendocument-odpgroup/#property-bounds)
- Property [OdpImage.Bounds](/api/open-document/officeimo-opendocument-odpimage/#property-bounds)
- Property [OdpLine.Bounds](/api/open-document/officeimo-opendocument-odpline/#property-bounds)
- Property [OdpRectangle.Bounds](/api/open-document/officeimo-opendocument-odprectangle/#property-bounds)
- Property [OdpShape.Bounds](/api/open-document/officeimo-opendocument-odpshape/#property-bounds)
- Property [OdpTable.Bounds](/api/open-document/officeimo-opendocument-odptable/#property-bounds)
- Property [OdpTextBox.Bounds](/api/open-document/officeimo-opendocument-odptextbox/#property-bounds)
- Property [OdsChart.Bounds](/api/open-document/officeimo-opendocument-odschart/#property-bounds)

### Accepted by parameters 18

- Method [OdgShapes.AddEllipse](/api/open-document/officeimo-opendocument-odgshapes/#method-addellipse-officeimo-opendocument-odfrect-string) parameter `bounds`
- Method [OdgShapes.AddImage](/api/open-document/officeimo-opendocument-odgshapes/#method-addimage-byte-string-officeimo-opendocument-odfrect-string) parameter `bounds`
- Method [OdgShapes.AddPath](/api/open-document/officeimo-opendocument-odgshapes/#method-addpath-officeimo-opendocument-odfrect-officeimo-opendocument-odfviewbox-string-string) parameter `bounds`
- Method [OdgShapes.AddPolygon](/api/open-document/officeimo-opendocument-odgshapes/#method-addpolygon-officeimo-opendocument-odfrect-officeimo-opendocument-odfviewbox-collections-generic-ienumerable-officeimo-drawing-officepoint-string) parameter `bounds`
- Method [OdgShapes.AddPolyline](/api/open-document/officeimo-opendocument-odgshapes/#method-addpolyline-officeimo-opendocument-odfrect-officeimo-opendocument-odfviewbox-collections-generic-ienumerable-officeimo-drawing-officepoint-string) parameter `bounds`
- Method [OdgShapes.AddRectangle](/api/open-document/officeimo-opendocument-odgshapes/#method-addrectangle-officeimo-opendocument-odfrect-string) parameter `bounds`
- Method [OdgShapes.AddRoundedRectangle](/api/open-document/officeimo-opendocument-odgshapes/#method-addroundedrectangle-officeimo-opendocument-odfrect-officeimo-opendocument-odflength-string) parameter `bounds`
- Method [OdgShapes.AddTextBox](/api/open-document/officeimo-opendocument-odgshapes/#method-addtextbox-officeimo-opendocument-odfrect-string-string) parameter `bounds`
- Method [OdpGroup.AddEllipse](/api/open-document/officeimo-opendocument-odpgroup/#method-addellipse-officeimo-opendocument-odfrect-string) parameter `bounds`
- Method [OdpGroup.AddRectangle](/api/open-document/officeimo-opendocument-odpgroup/#method-addrectangle-officeimo-opendocument-odfrect-string) parameter `bounds`
- Method [OdpGroup.AddTextBox](/api/open-document/officeimo-opendocument-odpgroup/#method-addtextbox-officeimo-opendocument-odfrect-string-string) parameter `bounds`
- Method [OdpPresentationLayout.AddPlaceholder](/api/open-document/officeimo-opendocument-odppresentationlayout/#method-addplaceholder-string-officeimo-opendocument-odfrect) parameter `bounds`
- Method [OdpSlide.AddEllipse](/api/open-document/officeimo-opendocument-odpslide/#method-addellipse-officeimo-opendocument-odfrect-string) parameter `bounds`
- Method [OdpSlide.AddImage](/api/open-document/officeimo-opendocument-odpslide/#method-addimage-byte-string-officeimo-opendocument-odfrect-string) parameter `bounds`
- Method [OdpSlide.AddRectangle](/api/open-document/officeimo-opendocument-odpslide/#method-addrectangle-officeimo-opendocument-odfrect-string) parameter `bounds`
- Method [OdpSlide.AddTable](/api/open-document/officeimo-opendocument-odpslide/#method-addtable-officeimo-opendocument-odfrect-int32-int32-string) parameter `bounds`
- Method [OdpSlide.AddTextBox](/api/open-document/officeimo-opendocument-odpslide/#method-addtextbox-officeimo-opendocument-odfrect-string-string) parameter `bounds`
- Method [OdsSheet.AddChart](/api/open-document/officeimo-opendocument-odssheet/#method-addchart-officeimo-opendocument-odscharttype-string-collections-generic-ireadonlylist-officeimo-opendocument-odschartseries-int64-int64-officeimo-opendocument-odfrect-string-string) parameter `bounds`

Filter members 

Show inherited

## Constructors

`public OdfRect(OdfLength x, OdfLength y, OdfLength width, OdfLength height)` [#](#constructor-ctor-officeimo-opendocument-odflength-officeimo-opendocument-odflength-officeimo-opendocument-odflength-officeimo-opendocument-odflength)

[OdfRect.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfRect.cs#L7)

Creates a rectangle.

Parameters

**x OfficeIMO.OpenDocument.OdfLength required**

**y OfficeIMO.OpenDocument.OdfLength required**

**width OfficeIMO.OpenDocument.OdfLength required**

**height OfficeIMO.OpenDocument.OdfLength required**

## Methods

`public static OdfRect FromCentimeters(double x, double y, double width, double height)` [#](#method-fromcentimeters-double-double-double-double)

[OdfRect.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfRect.cs#L24)

Creates a rectangle in centimeters.

Parameters

**x double required**

**y double required**

**width double required**

**height double required**

Returns

`OdfRect`

## Inherited Methods

`public override bool Equals(object? obj)` [#](#method-equals-object)

Inherited from ValueType

Parameters

**obj object? required**

Returns

`bool`

`public override int GetHashCode()` [#](#method-gethashcode)

Inherited from ValueType

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public override string? ToString()` [#](#method-tostring)

Inherited from ValueType

Returns

`string?`

## Properties

`public OdfLength X { get; }` [#](#property-x)

[OdfRect.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfRect.cs#L14)

Horizontal position.

`public OdfLength Y { get; }` [#](#property-y)

[OdfRect.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfRect.cs#L16)

Vertical position.

`public OdfLength Width { get; }` [#](#property-width)

[OdfRect.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfRect.cs#L18)

Width.

`public OdfLength Height { get; }` [#](#property-height)

[OdfRect.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfRect.cs#L20)

Height.

<!-- PowerForge markdown artifact sha256:AFE597CEC84605A9FF146FB1A7B15FD7D71952906AD631C540694A20B22F9DFE -->
