# RenderTargetBitmap

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

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

```rust
struct RenderTargetBitmap
```

A bitmap that holds the rendering of a visual.

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

## Members

- [`new`](#function-new)
- [`with_dpi`](#function-with_dpi)
- [`render`](#function-render)
- [`create_drawing_context`](#function-create_drawing_context)
- [`create_drawing_context_with_clear`](#function-create_drawing_context_with_clear)
- [`dispose`](#function-dispose)

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

### new

```rust
fn new(pixel_size: PixelSize) -> RenderTargetBitmap
```

Creates a bitmap of the given size, in pixels, at 96 DPI.

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

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

### with_dpi

```rust
fn with_dpi(pixel_size: PixelSize, dpi: Vector) -> RenderTargetBitmap
```

Creates a bitmap of the given size, in pixels, and DPI.

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

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

### render

```rust
fn render(self: &Self, visual: &Ref<Visual>)
```

Renders a visual to the bitmap.

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

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

### create_drawing_context

```rust
fn create_drawing_context(self: &Self) -> DrawingContext<'static>
```

Creates a drawing context that draws into the bitmap, after clearing
the bitmap. Disposing (or dropping) the context finishes the drawing.

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

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

### create_drawing_context_with_clear

```rust
fn create_drawing_context_with_clear(self: &Self, clear: bool) -> DrawingContext<'static>
```

Creates a drawing context that draws into the bitmap, clearing the
bitmap first when `clear` is set.

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

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

### dispose

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

Releases the bitmap's references to the platform bitmap.

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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`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`
- [`IImage`](/docs/0.5.0/api/ferroui-base/media/trait-iimage/)
- [`IBitmap`](/docs/0.5.0/api/ferroui-base/media/imaging/trait-ibitmap/)
- [`IImageBrushSource`](/docs/0.5.0/api/ferroui-base/media/trait-iimagebrushsource/)

## Availability

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