pub struct CompositionVisualSurface { /* private fields */ }Expand description
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.
Implementations§
Source§impl CompositionVisualSurface
impl CompositionVisualSurface
pub fn compositor(&self) -> &Rc<Compositor>
Sourcepub fn object(&self) -> &CompositionObject
pub fn object(&self) -> &CompositionObject
The embedded CompositionObject.
Sourcepub fn server(&self) -> ServerObjectId
pub fn server(&self) -> ServerObjectId
The id of the server-side surface.
pub fn is_disposed(&self) -> bool
pub fn dispose(&self)
Sourcepub fn props(&self) -> &CompositionVisualSurfaceProps
pub fn props(&self) -> &CompositionVisualSurfaceProps
The generated properties of the surface.
Sourcepub fn source_visual(&self) -> Option<Rc<CompositionVisual>>
pub fn source_visual(&self) -> Option<Rc<CompositionVisual>>
The visual whose subtree the surface shows.
pub fn set_source_visual(&self, value: Option<Rc<CompositionVisual>>)
Sourcepub fn source_offset(&self) -> Vector
pub fn source_offset(&self) -> Vector
The top left corner of the area shown, in the coordinates of the
source visual (WinUI Vector2; animatable as SourceOffset).
pub fn set_source_offset(&self, value: Vector)
Sourcepub fn source_size(&self) -> Vector
pub fn source_size(&self) -> Vector
The size of the area shown; zero for the size of the source visual
(WinUI Vector2; animatable as SourceSize).
pub fn set_source_size(&self, value: Vector)
Sourcepub fn freeze(&self)
pub fn freeze(&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§
Source§impl AsCompositionObject for CompositionVisualSurface
impl AsCompositionObject for CompositionVisualSurface
Source§fn as_composition_object(&self) -> &CompositionObject
fn as_composition_object(&self) -> &CompositionObject
CompositionObject.Source§fn composition_type_name(&self) -> &'static str
fn composition_type_name(&self) -> &'static str
Source§fn as_property_set(self: Rc<Self>) -> Option<Rc<CompositionPropertySet>>
fn as_property_set(self: Rc<Self>) -> Option<Rc<CompositionPropertySet>>
is CompositionPropertySet test of upstream).Source§impl CompositionVisualSurfaceHooks for CompositionVisualSurface
InitializeDefaultsExtra activates the server object: done when the
server object is created.
impl CompositionVisualSurfaceHooks for CompositionVisualSurface
InitializeDefaultsExtra activates the server object: done when the
server object is created.
fn initialize_defaults_extra(&self)
fn validate_source_visual_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )
fn on_source_visual_changed(&self)
fn on_source_visual_changing(&self)
fn validate_source_offset_change(&self, _old_value: Vector, _new_value: Vector)
fn on_source_offset_changed(&self)
fn on_source_offset_changing(&self)
fn validate_source_size_change(&self, _old_value: Vector, _new_value: Vector)
fn on_source_size_changed(&self)
fn on_source_size_changing(&self)
Source§impl ICompositionObjectAnimations for CompositionVisualSurface
impl ICompositionObjectAnimations for CompositionVisualSurface
Source§fn try_start_animation(
&self,
property_name: &str,
animation: &dyn ICompositionAnimation,
final_value: Option<ExpressionVariant>,
) -> bool
fn try_start_animation( &self, property_name: &str, animation: &dyn ICompositionAnimation, final_value: Option<ExpressionVariant>, ) -> bool
StartAnimation(propertyName, animation, finalValue) of the class:
returns false for a property the class does not know.Source§fn get_composition_property(
&self,
property_name: &str,
) -> Option<&'static CompositionProperty>
fn get_composition_property( &self, property_name: &str, ) -> Option<&'static CompositionProperty>
Source§fn composition_object(&self) -> &CompositionObject
fn composition_object(&self) -> &CompositionObject
CompositionObject.Source§fn start_animation(
&self,
property_name: &str,
animation: &dyn ICompositionAnimation,
)
fn start_animation( &self, property_name: &str, animation: &dyn ICompositionAnimation, )
Source§fn start_animation_with_final_value(
&self,
property_name: &str,
animation: &dyn ICompositionAnimation,
final_value: Option<ExpressionVariant>,
)
fn start_animation_with_final_value( &self, property_name: &str, animation: &dyn ICompositionAnimation, final_value: Option<ExpressionVariant>, )
start_animation. property_name may
name a sub-channel of a vector property (Offset.X, Scale.XY,
components X, Y, Z, W in any case): the animation then animates a
value of the sub-channel’s type (a scalar for one component, a
Vector2 for two, …) and leaves the other components alone. Several
sub-channels of one property run together; an animation of the whole
property replaces them.Source§fn start_animation_with_controller(
&self,
property_name: &str,
animation: &dyn ICompositionAnimation,
controller: &Rc<AnimationController>,
)
fn start_animation_with_controller( &self, property_name: &str, animation: &dyn ICompositionAnimation, controller: &Rc<AnimationController>, )
StartAnimation(propertyName, animation, animationController): starts
the animation under controller, which can pause, resume, scrub and
speed it up. property_name may name a sub-channel, as for
start_animation.Source§fn try_get_animation_controller(
&self,
property_name: &str,
) -> Option<Rc<AnimationController>>
fn try_get_animation_controller( &self, property_name: &str, ) -> Option<Rc<AnimationController>>
TryGetAnimationController): the controller it was started with, or
a new controller that takes the running animation over. None when no
animation was started on the property through this object, or it was
stopped.Source§fn stop_animation(&self, property_name: &str)
fn stop_animation(&self, property_name: &str)
property_name may name a sub-channel
(Offset.X): the animations of the sub-channels that share a
component with it are stopped.Source§fn start_animation_group(&self, grp: &dyn ICompositionAnimationBase)
fn start_animation_group(&self, grp: &dyn ICompositionAnimationBase)
Source§fn start_animation_group_part(
&self,
animation: &dyn ICompositionAnimation,
target: &str,
final_value: ExpressionVariant,
) -> bool
fn start_animation_group_part( &self, animation: &dyn ICompositionAnimation, target: &str, final_value: ExpressionVariant, ) -> bool
StartAnimationGroupPart.Source§fn start_animation_group_for(
&self,
grp: &dyn ICompositionAnimationBase,
target: &str,
final_value: ExpressionVariant,
) -> bool
fn start_animation_group_for( &self, grp: &dyn ICompositionAnimationBase, target: &str, final_value: ExpressionVariant, ) -> bool
target to final_value. Returns whether one of the
animations targets that property.Source§fn stop_animation_group(&self, grp: &dyn ICompositionAnimationBase)
fn stop_animation_group(&self, grp: &dyn ICompositionAnimationBase)
Source§impl ICompositionObjectHost for CompositionVisualSurface
impl ICompositionObjectHost for CompositionVisualSurface
Source§fn server(&self) -> ServerObjectId
fn server(&self) -> ServerObjectId
Source§fn pending_animations(&self) -> &PendingAnimations
fn pending_animations(&self) -> &PendingAnimations
Source§fn implicit_animation(
&self,
property_name: &str,
) -> Option<Rc<dyn ICompositionAnimationBase>>
fn implicit_animation( &self, property_name: &str, ) -> Option<Rc<dyn ICompositionAnimationBase>>
ImplicitAnimations?.TryGetValue(name)).Source§fn start_animation_group(
&self,
grp: &Rc<dyn ICompositionAnimationBase>,
target: &str,
final_value: ExpressionVariant,
) -> bool
fn start_animation_group( &self, grp: &Rc<dyn ICompositionAnimationBase>, target: &str, final_value: ExpressionVariant, ) -> bool
target to final_value. Returns whether one of the
animations targets that property.impl ICompositionSurface for CompositionVisualSurface
Source§impl ICompositorSerializable for CompositionVisualSurface
impl ICompositorSerializable for CompositionVisualSurface
Source§fn try_get_server(&self, c: &Compositor) -> Option<ServerObjectId>
fn try_get_server(&self, c: &Compositor) -> Option<ServerObjectId>
c, if it
has one.Source§fn serialize_changes(&self, c: &Compositor, writer: &mut BatchStreamWriter<'_>)
fn serialize_changes(&self, c: &Compositor, writer: &mut BatchStreamWriter<'_>)
c.Source§fn serialization_key(&self) -> *const ()
fn serialization_key(&self) -> *const ()
Source§fn prepare_serialization(&self, _c: &Compositor)
fn prepare_serialization(&self, _c: &Compositor)
c. Read moreAuto Trait Implementations§
impl !Freeze for CompositionVisualSurface
impl !RefUnwindSafe for CompositionVisualSurface
impl !Send for CompositionVisualSurface
impl !Sync for CompositionVisualSurface
impl !UnwindSafe for CompositionVisualSurface
impl Unpin for CompositionVisualSurface
impl UnsafeUnpin for CompositionVisualSurface
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