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.
Members
compositorobjectis_disposeddisposeblur_radiusset_blur_radiuscolorset_coloroffsetset_offsetopacityset_opacitymaskset_masksource_policyset_source_policy
compositor
fn compositor(self: &Self) -> &Rc<Compositor>
object
fn object(self: &Self) -> &CompositionObject
The embedded CompositionObject.
is_disposed
fn is_disposed(self: &Self) -> bool
dispose
fn dispose(self: &Self)
blur_radius
fn blur_radius(self: &Self) -> f32
The radius of the blur (default 9).
set_blur_radius
fn set_blur_radius(self: &Self, value: f32)
color
fn color(self: &Self) -> Color
The colour of the shadow (default black).
set_color
fn set_color(self: &Self, value: Color)
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.
set_offset
fn set_offset(self: &Self, value: Vector3D)
opacity
fn opacity(self: &Self) -> f32
The opacity of the shadow (default 1).
set_opacity
fn set_opacity(self: &Self, value: f32)
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.
set_mask
fn set_mask(self: &Self, value: Option<Rc<CompositionBrush>>)
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).
set_source_policy
fn set_source_policy(self: &Self, value: CompositionDropShadowSourcePolicy)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherDropShadowHooksIRegisterForSerializationICompositionObjectHostICompositionObjectAnimationsAsCompositionObjectICompositionObjectICompositorSerializable
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.