FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    DropShadow

    struct · ferroui-base · v0.5.0

    struct DropShadow
    

    The shadow of a sprite or layer visual (WinUI Microsoft.UI.Composition.DropShadow), with animatable BlurRadius, Color, Offset and Opacity.

    On a sprite visual the shadow is cast by the rectangle of the visual (a box shadow of the drawing context), by the alpha of its mask (any composition brush, such as the brush of GetAlphaMask of a shape, a text block or an image), or, with the InheritFromVisualContent source_policy, by the alpha of the brush of the visual. On a layer visual it is cast by the composed children, or by the mask. The shadow is drawn under the content and nothing of it is removed; the Z of the offset moves it as the renderers project that depth for the visual (a visual turned out of its plane).

    Deviation (winui-composition.md): without effects in the drawing context the shadow is the box shadow of the rectangle. WinUI's CompositionShadow base class has no members and is not a separate type.

    View source

    Members

    compositor

    fn compositor(self: &Self) -> &Rc<Compositor>
    

    Source

    object

    fn object(self: &Self) -> &CompositionObject
    

    The embedded CompositionObject.

    Source

    is_disposed

    fn is_disposed(self: &Self) -> bool
    

    Source

    dispose

    fn dispose(self: &Self)
    

    Source

    blur_radius

    fn blur_radius(self: &Self) -> f32
    

    The radius of the blur (default 9).

    Source

    set_blur_radius

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

    Source

    color

    fn color(self: &Self) -> Color
    

    The colour of the shadow (default black).

    Source

    set_color

    fn set_color(self: &Self, value: Color)
    

    Source

    offset

    fn offset(self: &Self) -> Vector3D
    

    The offset of the shadow from the visual (WinUI Vector3). The Z is a depth in the space of the visual: it moves the shadow only where the visual is turned out of its plane (Orientation, RotationAxis), as the renderers project that visual.

    Source

    set_offset

    fn set_offset(self: &Self, value: Vector3D)
    

    Source

    opacity

    fn opacity(self: &Self) -> f32
    

    The opacity of the shadow (default 1).

    Source

    set_opacity

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

    Source

    mask

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

    The brush whose alpha shapes the shadow, painted over the area of the visual; None for the shape of the visual. Ignored with the InheritFromVisualContent source policy.

    Source

    set_mask

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

    Source

    source_policy

    fn source_policy(self: &Self) -> CompositionDropShadowSourcePolicy
    

    What the shadow is cast from: Default for the mask (or the shape of the visual), InheritFromVisualContent for the alpha of the content of the visual (the brush of a sprite visual, the children of a layer visual).

    Source

    set_source_policy

    fn set_source_policy(self: &Self, value: CompositionDropShadowSourcePolicy)
    

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither
    • DropShadowHooks
    • IRegisterForSerialization
    • ICompositionObjectHost
    • ICompositionObjectAnimations
    • AsCompositionObject
    • ICompositionObject
    • ICompositorSerializable

    Availability

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