# InkStrokeBuilder

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

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

```rust
struct InkStrokeBuilder
```

Stateful builder with separate Begin/Append/End and snapshot APIs.
End consumes the pending input only after a stroke has been validated.

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

## Members

- [`new`](#function-new)
- [`set_default_drawing_attributes`](#function-set_default_drawing_attributes)
- [`default_drawing_attributes`](#function-default_drawing_attributes)
- [`create_stroke`](#function-create_stroke)
- [`create_stroke_from_ink_points`](#function-create_stroke_from_ink_points)
- [`begin_stroke`](#function-begin_stroke)
- [`append_to_stroke`](#function-append_to_stroke)
- [`end_stroke`](#function-end_stroke)
- [`cancel_stroke`](#function-cancel_stroke)
- [`is_building_stroke`](#function-is_building_stroke)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Inking/ink_stroke_builder.rs#L30)

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

### set_default_drawing_attributes

```rust
fn set_default_drawing_attributes(self: &Self, value: InkDrawingAttributes) -> Result<(), InkError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Inking/ink_stroke_builder.rs#L33)

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

### default_drawing_attributes

```rust
fn default_drawing_attributes(self: &Self) -> InkDrawingAttributes
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Inking/ink_stroke_builder.rs#L41)

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

### create_stroke

```rust
fn create_stroke(self: &Self, points: impl IntoIterator<Item = Point>) -> Result<Rc<InkStroke>, InkError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Inking/ink_stroke_builder.rs#L44)

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

### create_stroke_from_ink_points

```rust
fn create_stroke_from_ink_points(self: &Self, points: impl IntoIterator<Item = InkPoint>, transform: Matrix) -> Result<Rc<InkStroke>, InkError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Inking/ink_stroke_builder.rs#L55)

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

### begin_stroke

```rust
fn begin_stroke(self: &Self, point: InkPoint) -> Result<(), InkError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Inking/ink_stroke_builder.rs#L68)

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

### append_to_stroke

```rust
fn append_to_stroke(self: &Self, point: InkPoint) -> Result<(), InkError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Inking/ink_stroke_builder.rs#L81)

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

### end_stroke

```rust
fn end_stroke(self: &Self, point: InkPoint) -> Result<Rc<InkStroke>, InkError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Inking/ink_stroke_builder.rs#L106)

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

### cancel_stroke

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Inking/ink_stroke_builder.rs#L118)

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

### is_building_stroke

```rust
fn is_building_stroke(self: &Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Inking/ink_stroke_builder.rs#L121)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `IUnknownImpl`
- `Default`

## Availability

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