# ImageDrawing

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

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

```rust
struct ImageDrawing
```

Draws an image within a region defined by a [`Rect`](/docs/0.5.0/api/ferroui-base/struct-rect/).

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`image_source_property`](#function-image_source_property)
- [`rect_property`](#function-rect_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`image_source`](#function-image_source)
- [`set_image_source`](#function-set_image_source)
- [`rect`](#function-rect)
- [`set_rect`](#function-set_rect)

<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/image_drawing.rs#L14)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### image_source_property

```rust
fn image_source_property() -> &'static StyledProperty<Option<Rc<dyn IImage>>>
```

Defines the `ImageSource` property.

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

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

### rect_property

```rust
fn rect_property() -> &'static StyledProperty<Rect>
```

Defines the `Rect` property.

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

<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/image_drawing.rs#L53)

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

### new

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



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

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

### image_source

```rust
fn image_source(self: &Self) -> Option<Rc<dyn IImage>>
```

The source of the image.

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

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

### set_image_source

```rust
fn set_image_source(self: &Self, value: Option<Rc<dyn IImage>>)
```



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

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

### rect

```rust
fn rect(self: &Self) -> Rect
```

The region in which the image is drawn.

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

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

### set_rect

```rust
fn set_rect(self: &Self, value: Rect)
```



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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`DrawingImplExt`](/docs/0.5.0/api/ferroui-base/media/trait-drawingimplext/)
- [`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<ImageDrawing>`](/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/)
- [`DrawingImpl`](/docs/0.5.0/api/ferroui-base/media/trait-drawingimpl/)

## Availability

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