# WindowIcon

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

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

```rust
struct WindowIcon
```

Represents an icon for a window.

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

## Members

- [`from_bitmap`](#function-from_bitmap)
- [`from_file`](#function-from_file)
- [`from_stream`](#function-from_stream)
- [`save`](#function-save)

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

### from_bitmap

```rust
fn from_bitmap(bitmap: &Bitmap) -> Rc<WindowIcon>
```

Creates an icon from a bitmap.
## Panics
Panics when no platform icon loader is registered.

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

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

### from_file

```rust
fn from_file(file_name: &str) -> io::Result<Rc<WindowIcon>>
```

Loads an icon from a file.
## Panics
Panics when no platform icon loader is registered.

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

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

### from_stream

```rust
fn from_stream(stream: &mut dyn io::Read) -> io::Result<Rc<WindowIcon>>
```

Loads an icon from a stream.
## Panics
Panics when no platform icon loader is registered.

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

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

### save

```rust
fn save(self: &Self, stream: &mut dyn io::Write) -> io::Result<()>
```

Writes the icon to a stream.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`MarkupTyped`](/docs/0.5.0/api/ferroui-base/metadata/trait-markuptyped/)
- [`ValueTypeRegistration`](/docs/0.5.0/api/ferroui-base/data/core/trait-valuetyperegistration/)
- `PartialEq`

## Availability

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