FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SpriteVisual

    struct · ferroui-base · v0.5.0

    struct SpriteVisual
    

    A visual that paints its size with a composition brush and casts a shadow (WinUI Microsoft.UI.Composition.SpriteVisual): the shadow of its rectangle, then the brush over (0, 0, size), then its children.

    The brush is any CompositionBrush: the colour and gradient brushes fill the rectangle, a CompositionSurfaceBrush lays out its surface in it. A change of the brush or of the shadow, an animation included, redraws the visual.

    Unlike the other visuals of the compositor, a sprite visual does not clip to its bounds when it is created (clip_to_bounds is false), as a WinUI visual: its shadow and its children may extend beyond its size.

    View source

    Members

    from_visual

    fn from_visual(visual: &Rc<CompositionVisual>) -> Option<SpriteVisual>
    

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

    Source

    visual

    fn visual(self: &Self) -> &Rc<CompositionVisual>
    

    The visual as a composition visual.

    Source

    brush

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

    The brush the visual paints its size with.

    Source

    set_brush

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

    Source

    shadow

    fn shadow(self: &Self) -> Option<Rc<DropShadow>>
    

    The shadow of the visual.

    Source

    set_shadow

    fn set_shadow(self: &Self, value: Option<Rc<DropShadow>>)
    

    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.