FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    LayerVisual

    struct · ferroui-base · v0.5.0

    struct LayerVisual
    

    A container visual whose children are composed into one offscreen layer, which is then drawn with the opacity of the visual and its shadow (WinUI Microsoft.UI.Composition.LayerVisual).

    The shadow of a layer visual follows the alpha of the composed children where the drawing context can draw a drop shadow of a layer (the Skia and Vello backends); elsewhere it is the box shadow of the rectangle of the visual, as the shadow of a sprite visual.

    The effect (an effect brush) is applied to the composed children: they are the first source parameter of its graph, and the rest of the graph is drawn around them (a blur pushes the blur effect of the drawing context around the layer, a composite draws its other sources under and over it).

    Like a sprite visual, a layer visual does not clip to its bounds when it is created (clip_to_bounds is false).

    View source

    Members

    from_visual

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

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

    Source

    visual

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

    The visual as a composition visual.

    Source

    shadow

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

    The shadow of the composed layer.

    Source

    set_shadow

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

    Source

    effect

    fn effect(self: &Self) -> Option<CompositionEffectBrush>
    

    Effect: the effect brush applied to the composed children, which are the first source parameter of its graph. (The upstream effect of every visual, an image effect, is visual().effect().)

    Source

    set_effect

    fn set_effect(self: &Self, value: Option<CompositionEffectBrush>)
    

    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.