# IBitmap

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/imaging/trait-ibitmap/

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

```rust
trait IBitmap: IImage
```

Represents a bitmap image.

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

## Members

- [`dpi`](#function-dpi)
- [`pixel_size`](#function-pixel_size)
- [`save`](#function-save)
- [`dispose`](#function-dispose)

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

### dpi

```rust
fn dpi(self: &Self) -> Vector
```

The dots per inch (DPI) of the image.

Note that the backend may not support DPI information; in that case
the default of 96 is reported.

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

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

### pixel_size

```rust
fn pixel_size(self: &Self) -> PixelSize
```

The size of the bitmap, in device pixels.

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

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

### save

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

Saves the bitmap to a stream.

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

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

### dispose

```rust
fn dispose(self: &Self)
```

Releases the bitmap.

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

## Trait implementations

- [`IBitmap`](/docs/0.5.0/api/ferroui-base/media/imaging/trait-ibitmap/)

## Availability

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