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.
Members
from_shapeshapefill_brushset_fill_brushgeometryset_geometryis_stroke_non_scalingset_is_stroke_non_scalingstroke_brushset_stroke_brushstroke_dash_arrayset_stroke_dash_arraystroke_dash_capset_stroke_dash_capstroke_dash_offsetset_stroke_dash_offsetstroke_end_capset_stroke_end_capstroke_line_joinset_stroke_line_joinstroke_miter_limitset_stroke_miter_limitstroke_start_capset_stroke_start_capstroke_thicknessset_stroke_thickness
from_shape
fn from_shape(shape: &Rc<CompositionShape>) -> Option<CompositionSpriteShape>
The handle of shape as a sprite shape, if it is one.
shape
fn shape(self: &Self) -> &Rc<CompositionShape>
The shape as a CompositionShape.
fill_brush
fn fill_brush(self: &Self) -> Option<Rc<CompositionBrush>>
The brush the geometry is filled with.
set_fill_brush
fn set_fill_brush(self: &Self, value: Option<Rc<CompositionBrush>>)
geometry
fn geometry(self: &Self) -> Option<Rc<CompositionGeometry>>
The geometry the shape draws.
set_geometry
fn set_geometry(self: &Self, value: Option<Rc<CompositionGeometry>>)
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).
set_is_stroke_non_scaling
fn set_is_stroke_non_scaling(self: &Self, value: bool)
stroke_brush
fn stroke_brush(self: &Self) -> Option<Rc<CompositionBrush>>
The brush the outline is stroked with.
set_stroke_brush
fn set_stroke_brush(self: &Self, value: Option<Rc<CompositionBrush>>)
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.
set_stroke_dash_array
fn set_stroke_dash_array(self: &Self, value: Vec<f32>)
stroke_dash_cap
fn stroke_dash_cap(self: &Self) -> CompositionStrokeCap
The cap of the ends of the dashes (stored only, see the type).
set_stroke_dash_cap
fn set_stroke_dash_cap(self: &Self, value: CompositionStrokeCap)
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.
set_stroke_dash_offset
fn set_stroke_dash_offset(self: &Self, value: f32)
stroke_end_cap
fn stroke_end_cap(self: &Self) -> CompositionStrokeCap
The cap of the end of the stroke (stored only, see the type).
set_stroke_end_cap
fn set_stroke_end_cap(self: &Self, value: CompositionStrokeCap)
stroke_line_join
fn stroke_line_join(self: &Self) -> CompositionStrokeLineJoin
How the segments of the stroke are joined (default Miter).
set_stroke_line_join
fn set_stroke_line_join(self: &Self, value: CompositionStrokeLineJoin)
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).
set_stroke_miter_limit
fn set_stroke_miter_limit(self: &Self, value: f32)
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.
set_stroke_start_cap
fn set_stroke_start_cap(self: &Self, value: CompositionStrokeCap)
stroke_thickness
fn stroke_thickness(self: &Self) -> f32
The thickness of the stroke (default 1).
set_stroke_thickness
fn set_stroke_thickness(self: &Self, value: f32)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyToOwnedErasedDestructorIntoEitherCloneDeref
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.