FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    CompositionSpriteShape

    struct · ferroui-base · v0.5.0

    struct CompositionSpriteShape
    

    A shape that fills and strokes a geometry (WinUI Microsoft.UI.Composition.CompositionSpriteShape).

    The fill and the stroke are composition brushes: the colour and gradient brushes are brushes of the drawing context, a CompositionSurfaceBrush is painted inside the geometry (the fill) or inside the widened outline (the stroke). StrokeThickness, StrokeDashOffset and StrokeMiterLimit are animatable.

    Deviation (winui-composition.md): the platform pen has one line cap, so stroke_start_cap caps both ends of the stroke and the dashes; stroke_end_cap and stroke_dash_cap are stored only. A non-scaling stroke divides the thickness by the scale of the transforms of the shape (the square root of the determinant), which is exact for a uniform scale only.

    View source

    Members

    from_shape

    fn from_shape(shape: &Rc<CompositionShape>) -> Option<CompositionSpriteShape>
    

    The handle of shape as a sprite shape, if it is one.

    Source

    shape

    fn shape(self: &Self) -> &Rc<CompositionShape>
    

    The shape as a CompositionShape.

    Source

    fill_brush

    fn fill_brush(self: &Self) -> Option<Rc<CompositionBrush>>
    

    The brush the geometry is filled with.

    Source

    set_fill_brush

    fn set_fill_brush(self: &Self, value: Option<Rc<CompositionBrush>>)
    

    Source

    geometry

    fn geometry(self: &Self) -> Option<Rc<CompositionGeometry>>
    

    The geometry the shape draws.

    Source

    set_geometry

    fn set_geometry(self: &Self, value: Option<Rc<CompositionGeometry>>)
    

    Source

    is_stroke_non_scaling

    fn is_stroke_non_scaling(self: &Self) -> bool
    

    Whether the thickness of the stroke ignores the transforms of the shape (and of the view box).

    Source

    set_is_stroke_non_scaling

    fn set_is_stroke_non_scaling(self: &Self, value: bool)
    

    Source

    stroke_brush

    fn stroke_brush(self: &Self) -> Option<Rc<CompositionBrush>>
    

    The brush the outline is stroked with.

    Source

    set_stroke_brush

    fn set_stroke_brush(self: &Self, value: Option<Rc<CompositionBrush>>)
    

    Source

    stroke_dash_array

    fn stroke_dash_array(self: &Self) -> Vec<f32>
    

    The lengths of the dashes and gaps of the stroke, in multiples of the stroke thickness (WinUI CompositionStrokeDashArray); empty for a solid stroke.

    Deviation (winui-composition.md): a plain list of values, replaced as a whole, not a CompositionObject of its own.

    Source

    set_stroke_dash_array

    fn set_stroke_dash_array(self: &Self, value: Vec<f32>)
    

    Source

    stroke_dash_cap

    fn stroke_dash_cap(self: &Self) -> CompositionStrokeCap
    

    The cap of the ends of the dashes (stored only, see the type).

    Source

    set_stroke_dash_cap

    fn set_stroke_dash_cap(self: &Self, value: CompositionStrokeCap)
    

    Source

    stroke_dash_offset

    fn stroke_dash_offset(self: &Self) -> f32
    

    How far into the dash pattern the stroke starts, in multiples of the stroke thickness.

    Source

    set_stroke_dash_offset

    fn set_stroke_dash_offset(self: &Self, value: f32)
    

    Source

    stroke_end_cap

    fn stroke_end_cap(self: &Self) -> CompositionStrokeCap
    

    The cap of the end of the stroke (stored only, see the type).

    Source

    set_stroke_end_cap

    fn set_stroke_end_cap(self: &Self, value: CompositionStrokeCap)
    

    Source

    stroke_line_join

    fn stroke_line_join(self: &Self) -> CompositionStrokeLineJoin
    

    How the segments of the stroke are joined (default Miter).

    Source

    set_stroke_line_join

    fn set_stroke_line_join(self: &Self, value: CompositionStrokeLineJoin)
    

    Source

    stroke_miter_limit

    fn stroke_miter_limit(self: &Self) -> f32
    

    The limit of the ratio of the miter length to half the thickness (default 2).

    Source

    set_stroke_miter_limit

    fn set_stroke_miter_limit(self: &Self, value: f32)
    

    Source

    stroke_start_cap

    fn stroke_start_cap(self: &Self) -> CompositionStrokeCap
    

    The cap of the start of the stroke; the platform pen caps both ends and the dashes with it.

    Source

    set_stroke_start_cap

    fn set_stroke_start_cap(self: &Self, value: CompositionStrokeCap)
    

    Source

    stroke_thickness

    fn stroke_thickness(self: &Self) -> f32
    

    The thickness of the stroke (default 1).

    Source

    set_stroke_thickness

    fn set_stroke_thickness(self: &Self, value: f32)
    

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Receiver
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Deref

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.