# OdgBackground

XML-backed background paint in a page or master's drawing-page style chain.

Class 

`OfficeIMO.OpenDocument`

**Namespace**

`OfficeIMO.OpenDocument`

**Assembly**

`OfficeIMO.OpenDocument`

**Source revision**

`15caddadea70` with working tree changes

**Source**

[OdgBackground.cs:77](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgBackground.cs#L77)

**Modifiers**

sealed

XML-backed background paint in a page or master's drawing-page style chain.

## Inheritance

- object
- OdgBackground

## Remarks

Page declarations override master paint except for native no-fill, which retains the master. Master edits affect all referencing pages. Referenced gradient definitions and image bytes remain shared.

## Usage

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

- Property [OdgPage.Background](/api/open-document/officeimo-opendocument-odgpage/#property-background)
- Property [OdgPage.MasterBackground](/api/open-document/officeimo-opendocument-odgpage/#property-masterbackground)

Filter members 

Show inherited

## Methods

`public byte[] GetBitmapBytes()` [#](#method-getbitmapbytes)

[OdgBackground.cs:77](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgBackground.cs#L77)

Returns embedded bitmap source bytes without fetching linked content.

Returns

`byte[]`

`public void SetBitmap(byte[] data, string fileName = "background.png")` [#](#method-setbitmap-byte-string)

[OdgBackground.cs:84](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgBackground.cs#L84)

Embeds a supported raster and selects stretched bitmap fill without changing opacity or paint area.

Parameters

**data byte[] required**

**fileName string = "background.png" optional**

`public void UseNoFill()` [#](#method-usenofill)

[OdgBackground.cs:98](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgBackground.cs#L98)

Selects native no-fill, retaining inactive declarations and resource definitions.

## 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 string? FillMode { get; }` [#](#property-fillmode)

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

Resolved native fill token in this owner's style chain, or null when absent. It does not include the other owner's paint.

`public OdfColor? FillColor { get; set; }` [#](#property-fillcolor)

[OdgBackground.cs:23](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgBackground.cs#L23)

Resolved solid fill color, or null for another fill mode. Setting null selects native no-fill.

`public string? FillGradientName { get; set; }` [#](#property-fillgradientname)

[OdgBackground.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgBackground.cs#L35)

Resolved gradient binding, or null for another fill mode. Setting null selects native no-fill.

`public double? FillOpacity { get; set; }` [#](#property-fillopacity)

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

Uniform opacity from zero to one in this owner's style chain. Null removes the local override.

`public int? GradientStepCount { get; set; }` [#](#property-gradientstepcount)

[OdgBackground.cs:60](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgBackground.cs#L60)

Resolved native gradient band count. Zero means automatic; three or more means fixed bands. Null removes the local override.

`public string? FillImageName { get; }` [#](#property-fillimagename)

[OdgBackground.cs:73](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Drawing/OdgBackground.cs#L73)

Resolved bitmap definition name, or null for another fill mode.

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