# Image

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/struct-image/

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

```rust
struct Image
```

Displays an `IImage`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L21)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`source_property`](#function-source_property)
- [`blend_mode_property`](#function-blend_mode_property)
- [`stretch_property`](#function-stretch_property)
- [`stretch_direction_property`](#function-stretch_direction_property)
- [`construct`](#function-construct)
- [`get_alpha_mask`](#function-get_alpha_mask)
- [`new`](#function-new)
- [`source`](#function-source)
- [`set_source`](#function-set_source)
- [`blend_mode`](#function-blend_mode)
- [`set_blend_mode`](#function-set_blend_mode)
- [`stretch`](#function-stretch)
- [`set_stretch`](#function-set_stretch)
- [`stretch_direction`](#function-stretch_direction)
- [`set_stretch_direction`](#function-set_stretch_direction)

<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.Controls/image.rs#L31)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L31)

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

### source_property

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

Defines the `Source` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L159)

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

### blend_mode_property

```rust
fn blend_mode_property() -> &'static StyledProperty<BitmapBlendingMode>
```

Defines the `BlendMode` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L159)

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

### stretch_property

```rust
fn stretch_property() -> &'static StyledProperty<Stretch>
```

Defines the `Stretch` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L159)

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

### stretch_direction_property

```rust
fn stretch_direction_property() -> &'static StyledProperty<StretchDirection>
```

Defines the `StretchDirection` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L159)

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

### construct

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

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L207)

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

### get_alpha_mask

```rust
fn get_alpha_mask(self: &Self) -> Option<Rc<CompositionBrush>>
```

`Image.GetAlphaMask`: a composition brush that shows the alpha of the
image as it is drawn (its source, stretched and placed), for the
`Mask` of a `DropShadow`
or another composition effect. The same brush is returned on every
call; it follows the image as it is drawn again (its source, stretch,
size and visibility). `None` when no compositor is available.

See `AlphaMask` for how the mask is drawn.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L225)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L229)

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

### source

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

Gets the image that will be displayed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L234)

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

### set_source

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

Sets the image that will be displayed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L239)

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

### blend_mode

```rust
fn blend_mode(self: &Self) -> BitmapBlendingMode
```

Gets the blend mode for the image.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L244)

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

### set_blend_mode

```rust
fn set_blend_mode(self: &Self, value: BitmapBlendingMode)
```

Sets the blend mode for the image.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L249)

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

### stretch

```rust
fn stretch(self: &Self) -> Stretch
```

Gets a value controlling how the image will be stretched.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L254)

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

### set_stretch

```rust
fn set_stretch(self: &Self, value: Stretch)
```

Sets a value controlling how the image will be stretched.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L259)

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

### stretch_direction

```rust
fn stretch_direction(self: &Self) -> StretchDirection
```

Gets a value controlling in what direction the image will be
stretched.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L265)

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

### set_stretch_direction

```rust
fn set_stretch_direction(self: &Self, value: StretchDirection)
```

Sets a value controlling in what direction the image will be
stretched.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/image.rs#L271)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- `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`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<Image>`](/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/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)

## Availability

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