pub struct CompositionSpriteShape(/* private fields */);Expand description
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.
Implementations§
Source§impl CompositionSpriteShape
impl CompositionSpriteShape
Sourcepub fn from_shape(
shape: &Rc<CompositionShape>,
) -> Option<CompositionSpriteShape>
pub fn from_shape( shape: &Rc<CompositionShape>, ) -> Option<CompositionSpriteShape>
The handle of shape as a sprite shape, if it is one.
Sourcepub fn shape(&self) -> &Rc<CompositionShape>
pub fn shape(&self) -> &Rc<CompositionShape>
The shape as a CompositionShape.
Sourcepub fn fill_brush(&self) -> Option<Rc<CompositionBrush>>
pub fn fill_brush(&self) -> Option<Rc<CompositionBrush>>
The brush the geometry is filled with.
pub fn set_fill_brush(&self, value: Option<Rc<CompositionBrush>>)
Sourcepub fn geometry(&self) -> Option<Rc<CompositionGeometry>>
pub fn geometry(&self) -> Option<Rc<CompositionGeometry>>
The geometry the shape draws.
pub fn set_geometry(&self, value: Option<Rc<CompositionGeometry>>)
Sourcepub fn is_stroke_non_scaling(&self) -> bool
pub fn is_stroke_non_scaling(&self) -> bool
Whether the thickness of the stroke ignores the transforms of the shape (and of the view box).
pub fn set_is_stroke_non_scaling(&self, value: bool)
Sourcepub fn stroke_brush(&self) -> Option<Rc<CompositionBrush>>
pub fn stroke_brush(&self) -> Option<Rc<CompositionBrush>>
The brush the outline is stroked with.
pub fn set_stroke_brush(&self, value: Option<Rc<CompositionBrush>>)
Sourcepub fn stroke_dash_array(&self) -> Vec<f32>
pub fn stroke_dash_array(&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.
pub fn set_stroke_dash_array(&self, value: Vec<f32>)
Sourcepub fn stroke_dash_cap(&self) -> CompositionStrokeCap
pub fn stroke_dash_cap(&self) -> CompositionStrokeCap
The cap of the ends of the dashes (stored only, see the type).
pub fn set_stroke_dash_cap(&self, value: CompositionStrokeCap)
Sourcepub fn stroke_dash_offset(&self) -> f32
pub fn stroke_dash_offset(&self) -> f32
How far into the dash pattern the stroke starts, in multiples of the stroke thickness.
pub fn set_stroke_dash_offset(&self, value: f32)
Sourcepub fn stroke_end_cap(&self) -> CompositionStrokeCap
pub fn stroke_end_cap(&self) -> CompositionStrokeCap
The cap of the end of the stroke (stored only, see the type).
pub fn set_stroke_end_cap(&self, value: CompositionStrokeCap)
Sourcepub fn stroke_line_join(&self) -> CompositionStrokeLineJoin
pub fn stroke_line_join(&self) -> CompositionStrokeLineJoin
How the segments of the stroke are joined (default Miter).
pub fn set_stroke_line_join(&self, value: CompositionStrokeLineJoin)
Sourcepub fn stroke_miter_limit(&self) -> f32
pub fn stroke_miter_limit(&self) -> f32
The limit of the ratio of the miter length to half the thickness (default 2).
pub fn set_stroke_miter_limit(&self, value: f32)
Sourcepub fn stroke_start_cap(&self) -> CompositionStrokeCap
pub fn stroke_start_cap(&self) -> CompositionStrokeCap
The cap of the start of the stroke; the platform pen caps both ends and the dashes with it.
pub fn set_stroke_start_cap(&self, value: CompositionStrokeCap)
Sourcepub fn stroke_thickness(&self) -> f32
pub fn stroke_thickness(&self) -> f32
The thickness of the stroke (default 1).
pub fn set_stroke_thickness(&self, value: f32)
Trait Implementations§
Source§impl Clone for CompositionSpriteShape
impl Clone for CompositionSpriteShape
Source§impl Deref for CompositionSpriteShape
impl Deref for CompositionSpriteShape
Source§type Target = Rc<CompositionShape>
type Target = Rc<CompositionShape>
Source§fn deref(&self) -> &Rc<CompositionShape>
fn deref(&self) -> &Rc<CompositionShape>
Auto Trait Implementations§
impl !RefUnwindSafe for CompositionSpriteShape
impl !Send for CompositionSpriteShape
impl !Sync for CompositionSpriteShape
impl !UnwindSafe for CompositionSpriteShape
impl Freeze for CompositionSpriteShape
impl Unpin for CompositionSpriteShape
impl UnsafeUnpin for CompositionSpriteShape
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more