# OdgShapes

An editable drawing-page, master or group collection. Unknown drawing elements remain visible and preserved.

Class 

`OfficeIMO.OpenDocument`

**Namespace**

`OfficeIMO.OpenDocument`

**Assembly**

`OfficeIMO.OpenDocument`

**Source revision**

`15caddadea70` with working tree changes

**Source**

[OdgShapes.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.cs#L26)

**Implements**

`IReadOnlyList<OdgShape>` `IReadOnlyCollection<OdgShape>` `IEnumerable<OdgShape>` `IEnumerable`

**Modifiers**

sealed

**Attributes**

`DefaultMember("Item")`

An editable drawing-page, master or group collection. Unknown drawing elements remain visible and preserved.

## Inheritance

- object
- OdgShapes

## Usage

Explore 4 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 4

- Property [OdgMasterPage.Shapes](/api/open-document/officeimo-opendocument-odgmasterpage/#property-shapes)
- Property [OdgPage.MasterShapes](/api/open-document/officeimo-opendocument-odgpage/#property-mastershapes)
- Property [OdgPage.Shapes](/api/open-document/officeimo-opendocument-odgpage/#property-shapes)
- Property [OdgShape.Children](/api/open-document/officeimo-opendocument-odgshape/#property-children)

Filter members 

Show inherited

## Methods

AddConnector 2 overloads

`public OdgShape AddConnector(OfficePoint start, OfficePoint end, OdgConnectorKind kind = Line, string? name = null)` [#](#method-addconnector-officeimo-drawing-officepoint-officeimo-drawing-officepoint-officeimo-opendocument-odgconnectorkind-string)

[OdgShapes.Connectors.cs:8](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.Connectors.cs#L8)

Adds a connector between free points in this collection's coordinate space.

Parameters

**start OfficeIMO.Drawing.OfficePoint required**

**end OfficeIMO.Drawing.OfficePoint required**

**kind OfficeIMO.OpenDocument.OdgConnectorKind = Line optional**

**name string? = null optional**

Returns

`OdgShape`

`public OdgShape AddConnector(OdgGluePoint start, OdgGluePoint end, string? name = null)` [#](#method-addconnector-officeimo-opendocument-odggluepoint-officeimo-opendocument-odggluepoint-string)

[OdgShapes.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.cs#L52)

Adds a straight connector attached to two explicit glue points on this page or master.

Parameters

**start OfficeIMO.OpenDocument.OdgGluePoint required**

**end OfficeIMO.OpenDocument.OdgGluePoint required**

**name string? = null optional**

Returns

`OdgShape`

`public OdgShape AddEllipse(OdfRect bounds, string? name = null)` [#](#method-addellipse-officeimo-opendocument-odfrect-string)

[OdgShapes.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.cs#L28)

Adds an ellipse.

Parameters

**bounds OfficeIMO.OpenDocument.OdfRect required**

**name string? = null optional**

Returns

`OdgShape`

`public OdgShape AddGroup(string? name = null)` [#](#method-addgroup-string)

[OdgShapes.cs:71](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.cs#L71)

Adds a group; its Children collection accepts the same shape operations.

Parameters

**name string? = null optional**

Returns

`OdgShape`

`public OdgShape AddImage(byte[] data, string fileName, OdfRect bounds, string? name = null)` [#](#method-addimage-byte-string-officeimo-opendocument-odfrect-string)

[OdgShapes.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.cs#L37)

Adds an embedded image using the existing ODF image store.

Parameters

**data byte[] required**

**fileName string required**

**bounds OfficeIMO.OpenDocument.OdfRect required**

**name string? = null optional**

Returns

`OdgShape`

`public OdgShape AddLine(OdfLength x1, OdfLength y1, OdfLength x2, OdfLength y2, string? name = null)` [#](#method-addline-officeimo-opendocument-odflength-officeimo-opendocument-odflength-officeimo-opendocument-odflength-officeimo-opendocument-odflength-string)

[OdgShapes.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.cs#L45)

Adds a line with absolute page coordinates.

Parameters

**x1 OfficeIMO.OpenDocument.OdfLength required**

**y1 OfficeIMO.OpenDocument.OdfLength required**

**x2 OfficeIMO.OpenDocument.OdfLength required**

**y2 OfficeIMO.OpenDocument.OdfLength required**

**name string? = null optional**

Returns

`OdgShape`

AddPath 2 overloads

`public OdgShape AddPath(OdfRect bounds, OdfViewBox viewBox, string pathData, string? name = null)` [#](#method-addpath-officeimo-opendocument-odfrect-officeimo-opendocument-odfviewbox-string-string)

[OdgShapes.Geometry.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.Geometry.cs#L13)

Adds a path whose SVG data uses the supplied local view box and is scaled to the page bounds.

Parameters

**bounds OfficeIMO.OpenDocument.OdfRect required**

**viewBox OfficeIMO.OpenDocument.OdfViewBox required**

**pathData string required**

**name string? = null optional**

Returns

`OdgShape`

`public OdgShape AddPath(OdfRect bounds, OdfViewBox viewBox, IEnumerable<OfficePathCommand> commands, string? name = null)` [#](#method-addpath-officeimo-opendocument-odfrect-officeimo-opendocument-odfviewbox-collections-generic-ienumerable-officeimo-drawing-officepathcommand-string)

[OdgShapes.Geometry.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.Geometry.cs#L18)

Adds a path using shared Drawing commands in the supplied local view box.

Parameters

**bounds OfficeIMO.OpenDocument.OdfRect required**

**viewBox OfficeIMO.OpenDocument.OdfViewBox required**

**commands System.Collections.Generic.IEnumerable<OfficeIMO.Drawing.OfficePathCommand> required**

**name string? = null optional**

Returns

`OdgShape`

`public OdgShape AddPolygon(OdfRect bounds, OdfViewBox viewBox, IEnumerable<OfficePoint> points, string? name = null)` [#](#method-addpolygon-officeimo-opendocument-odfrect-officeimo-opendocument-odfviewbox-collections-generic-ienumerable-officeimo-drawing-officepoint-string)

[OdgShapes.Geometry.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.Geometry.cs#L21)

Adds a closed polygon using integer coordinates in the supplied local view box.

Parameters

**bounds OfficeIMO.OpenDocument.OdfRect required**

**viewBox OfficeIMO.OpenDocument.OdfViewBox required**

**points System.Collections.Generic.IEnumerable<OfficeIMO.Drawing.OfficePoint> required**

**name string? = null optional**

Returns

`OdgShape`

`public OdgShape AddPolyline(OdfRect bounds, OdfViewBox viewBox, IEnumerable<OfficePoint> points, string? name = null)` [#](#method-addpolyline-officeimo-opendocument-odfrect-officeimo-opendocument-odfviewbox-collections-generic-ienumerable-officeimo-drawing-officepoint-string)

[OdgShapes.Geometry.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.Geometry.cs#L24)

Adds an open polyline using integer coordinates in the supplied local view box; its initial fill is none.

Parameters

**bounds OfficeIMO.OpenDocument.OdfRect required**

**viewBox OfficeIMO.OpenDocument.OdfViewBox required**

**points System.Collections.Generic.IEnumerable<OfficeIMO.Drawing.OfficePoint> required**

**name string? = null optional**

Returns

`OdgShape`

`public OdgShape AddRectangle(OdfRect bounds, string? name = null)` [#](#method-addrectangle-officeimo-opendocument-odfrect-string)

[OdgShapes.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.cs#L26)

Adds a rectangle.

Parameters

**bounds OfficeIMO.OpenDocument.OdfRect required**

**name string? = null optional**

Returns

`OdgShape`

`public OdgShape AddRoundedRectangle(OdfRect bounds, OdfLength radius, string? name = null)` [#](#method-addroundedrectangle-officeimo-opendocument-odfrect-officeimo-opendocument-odflength-string)

[OdgShapes.Geometry.cs:8](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.Geometry.cs#L8)

Adds a rectangle with circular corners. Oversized radii are clamped during rendering.

Parameters

**bounds OfficeIMO.OpenDocument.OdfRect required**

**radius OfficeIMO.OpenDocument.OdfLength required**

**name string? = null optional**

Returns

`OdgShape`

`public OdgShape AddTextBox(OdfRect bounds, string text, string? name = null)` [#](#method-addtextbox-officeimo-opendocument-odfrect-string-string)

[OdgShapes.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.cs#L31)

Adds a text frame.

Parameters

**bounds OfficeIMO.OpenDocument.OdfRect required**

**text string required**

**name string? = null optional**

Returns

`OdgShape`

`public IEnumerator<OdgShape> GetEnumerator()` [#](#method-getenumerator)

[OdgShapes.cs:114](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.cs#L114)

Returns an enumerator that iterates through the collection.

Returns

`IEnumerator<OdgShape>` An enumerator that can be used to iterate through the collection.

`public void Move(int sourceIndex, int destinationIndex)` [#](#method-move-int32-int32)

[OdgShapes.cs:101](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.cs#L101)

Changes a shape's paint-order position.

Parameters

**sourceIndex int required**

**destinationIndex int required**

`public void RemoveAt(int index)` [#](#method-removeat-int32)

[OdgShapes.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.cs#L74)

Removes one shape, including its children.

Parameters

**index int required**

## Inherited Methods

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

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

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

Inherited from object

Returns

`int`

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

Inherited from object

Returns

`Type`

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

Inherited from object

Returns

`string?`

## Properties

`public int Count { get; }` [#](#property-count)

[OdgShapes.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.cs#L22)

Number of shapes.

`public OdgShape this[int index] { get; }` [#](#property-item-int32)

[OdgShapes.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgShapes.cs#L24)

Shape at a zero-based paint-order position.

Parameters

**index int required**

<!-- PowerForge markdown artifact sha256:5D078EB28D70F83544714FEC8069F19FD1B4B91188B22B06B147EB4248455057 -->
