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.
Members
compositorobjectis_disposeddisposesource_visualset_source_visualsource_offsetset_source_offsetsource_sizeset_source_sizefreeze
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)
source_visual
fn source_visual(self: &Self) -> Option<Rc<CompositionVisual>>
The visual whose subtree the surface shows.
set_source_visual
fn set_source_visual(self: &Self, value: Option<Rc<CompositionVisual>>)
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).
set_source_offset
fn set_source_offset(self: &Self, value: Vector)
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).
set_source_size
fn set_source_size(self: &Self, value: Vector)
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherCompositionVisualSurfaceHooksICompositionSurfaceIRegisterForSerializationICompositionObjectHostICompositionObjectAnimationsAsCompositionObjectICompositionObjectICompositorSerializable
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.