pub struct LayerVisual(/* private fields */);Expand description
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).
Implementations§
Source§impl LayerVisual
impl LayerVisual
Sourcepub fn from_visual(visual: &Rc<CompositionVisual>) -> Option<LayerVisual>
pub fn from_visual(visual: &Rc<CompositionVisual>) -> Option<LayerVisual>
The handle of visual as a layer visual, if it is one.
Sourcepub fn visual(&self) -> &Rc<CompositionVisual>
pub fn visual(&self) -> &Rc<CompositionVisual>
The visual as a composition visual.
Sourcepub fn shadow(&self) -> Option<Rc<DropShadow>>
pub fn shadow(&self) -> Option<Rc<DropShadow>>
The shadow of the composed layer.
pub fn set_shadow(&self, value: Option<Rc<DropShadow>>)
Sourcepub fn effect(&self) -> Option<CompositionEffectBrush>
pub fn effect(&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().)
pub fn set_effect(&self, value: Option<CompositionEffectBrush>)
Trait Implementations§
Source§impl Clone for LayerVisual
impl Clone for LayerVisual
Source§impl Deref for LayerVisual
impl Deref for LayerVisual
Source§type Target = Rc<CompositionVisual>
type Target = Rc<CompositionVisual>
Source§fn deref(&self) -> &Rc<CompositionVisual>
fn deref(&self) -> &Rc<CompositionVisual>
Auto Trait Implementations§
impl !RefUnwindSafe for LayerVisual
impl !Send for LayerVisual
impl !Sync for LayerVisual
impl !UnwindSafe for LayerVisual
impl Freeze for LayerVisual
impl Unpin for LayerVisual
impl UnsafeUnpin for LayerVisual
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