# DrawingBrush

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

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

```rust
struct DrawingBrush
```

Paints an area with a [`Drawing`](/docs/0.5.0/api/ferroui-base/media/struct-drawing/).

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`drawing_property`](#function-drawing_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`with_drawing`](#function-with_drawing)
- [`drawing`](#function-drawing)
- [`set_drawing`](#function-set_drawing)
- [`create_content`](#function-create_content)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

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

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<DrawingBrush>
```

Returns a strong reference to this object.

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

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

### drawing_property

```rust
fn drawing_property() -> &'static StyledProperty<Option<Ref<Drawing>>>
```



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

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

### construct

```rust
fn construct() -> Self
```

Creates the class data.

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

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

### new

```rust
fn new() -> Ref<Self>
```



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

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

### with_drawing

```rust
fn with_drawing(drawing: impl Into<Nullable<Drawing>>) -> Ref<Self>
```

Creates a brush that draws `drawing`.

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

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

### drawing

```rust
fn drawing(self: &Self) -> Option<Ref<Drawing>>
```

The drawing to draw.

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

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

### set_drawing

```rust
fn set_drawing(self: &Self, value: impl Into<Nullable<Drawing>>)
```



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

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

### create_content

```rust
fn create_content(self: &Self) -> Option<Rc<dyn ISceneBrushContent>>
```

Records the current content of the brush: what the drawing draws.
`None` when there is no drawing or it draws nothing.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`BrushImplExt`](/docs/0.5.0/api/ferroui-base/media/trait-brushimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<DrawingBrush>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`BrushImpl`](/docs/0.5.0/api/ferroui-base/media/trait-brushimpl/)

## Availability

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