FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    CompositionVisualSurface

    struct · ferroui-base · v0.5.0

    struct CompositionVisualSurface
    

    A live image of the subtree of a visual, shown by a surface brush (WinUI Microsoft.UI.Composition.CompositionVisualSurface).

    The surface shows the area (source_offset, source_size) of source_visual, in the coordinates of the source; a zero source_size is the size of the source visual. The subtree is rendered as a bitmap cache renders it: the visibility, opacity, transform and clip of the source visual itself are ignored, so a hidden source still shows (the connected animation hides its elements and shows them through visual surfaces). Changes of the subtree are followed while the source is attached to a composition target.

    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

    source_visual

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

    The visual whose subtree the surface shows.

    Source

    set_source_visual

    fn set_source_visual(self: &Self, value: Option<Rc<CompositionVisual>>)
    

    Source

    source_offset

    fn source_offset(self: &Self) -> Vector
    

    The top left corner of the area shown, in the coordinates of the source visual (WinUI Vector2; animatable as SourceOffset).

    Source

    set_source_offset

    fn set_source_offset(self: &Self, value: Vector)
    

    Source

    source_size

    fn source_size(self: &Self) -> Vector
    

    The size of the area shown; zero for the size of the source visual (WinUI Vector2; animatable as SourceSize).

    Source

    set_source_size

    fn set_source_size(self: &Self, value: Vector)
    

    Source

    freeze

    fn freeze(self: &Self)
    

    Freezes the surface: the frame that applies the next batch renders the source into an offscreen layer once, and the surface shows that image from then on, whatever happens to the source.

    Not a public member in WinUI, where the connected animation freezes its snapshot surface internally. Best effort: the image is rendered with the bounds of the source subtree as of the last rendered frame.

    Source

    Trait implementations

    Availability

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