# ImmutableImageBrush

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/immutable/struct-immutableimagebrush/

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

```rust
struct ImmutableImageBrush
```

Paints an area with an image.

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

## Members

- [`new`](#function-new)
- [`from_bitmap`](#function-from_bitmap)
- [`from_brush`](#function-from_brush)
- [`source`](#function-source)

<a id="function-new"></a>

### new

```rust
fn new(source: Option<Rc<Bitmap>>, alignment_x: AlignmentX, alignment_y: AlignmentY, destination_rect: Option<RelativeRect>, opacity: f64, transform: Option<Rc<ImmutableTransform>>, transform_origin: RelativePoint, source_rect: Option<RelativeRect>, stretch: Stretch, tile_mode: TileMode, relative_transform: Option<Rc<ImmutableTransform>>) -> Self
```

Creates a brush. `destination_rect` and `source_rect` default to the
whole area.

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

<a id="function-from_bitmap"></a>

### from_bitmap

```rust
fn from_bitmap(source: Option<Rc<Bitmap>>) -> Self
```

Creates a brush drawing `source` with default values for everything
else: centered, uniformly stretched, not tiled and fully opaque.

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

<a id="function-from_brush"></a>

### from_brush

```rust
fn from_brush(source: &dyn IImageBrush) -> Self
```

Creates an immutable copy of `source`.

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

<a id="function-source"></a>

### source

```rust
fn source(self: &Self) -> Option<Rc<dyn IImageBrushSource>>
```

The image to draw.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ToOwned`
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Deref`
- [`IBrush`](/docs/0.5.0/api/ferroui-base/media/trait-ibrush/)
- [`ITileBrush`](/docs/0.5.0/api/ferroui-base/media/trait-itilebrush/)
- [`IImmutableBrush`](/docs/0.5.0/api/ferroui-base/media/trait-iimmutablebrush/)
- [`IImageBrush`](/docs/0.5.0/api/ferroui-base/media/trait-iimagebrush/)

## Availability

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