# BackgroundSizing

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/enum-backgroundsizing/

**enum** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
enum BackgroundSizing
```

Defines how a background is drawn relative to its border.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/background_sizing.rs#L4)

## Members

- [`InnerBorderEdge`](#variant-innerborderedge)
- [`OuterBorderEdge`](#variant-outerborderedge)
- [`CenterBorder`](#variant-centerborder)

<a id="variant-innerborderedge"></a>

### InnerBorderEdge

```rust
InnerBorderEdge = 0
```

The background is drawn up to the inside edge of the border.

The background will never be drawn under the border itself and will not be visible
underneath the border regardless of border transparency.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/background_sizing.rs#L10)

<a id="variant-outerborderedge"></a>

### OuterBorderEdge

```rust
OuterBorderEdge = 1
```

The background is drawn completely to the outside edge of the border.

The background will be visible underneath the border if the border has transparency.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/background_sizing.rs#L15)

<a id="variant-centerborder"></a>

### CenterBorder

```rust
CenterBorder = 2
```

The background is drawn to the midpoint (center) of the border.

The background will be visible underneath half of the border if the border has
transparency. For this reason it is not recommended to use
`CenterBorder` if transparency is involved.

This value does not exist in other XAML frameworks and only exists for backwards
compatibility with legacy code. Before `BackgroundSizing` was added, rendering always
used this value (Skia's default).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/background_sizing.rs#L26)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `Debug`
- `Default`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
