pub struct CompositionViewBox { /* private fields */ }Expand description
The area of the shape coordinates a shape visual or a geometric clip
shows (WinUI Microsoft.UI.Composition.CompositionViewBox): the
rectangle (offset, size) of the shapes is mapped onto the visual by
stretch and placed by the alignment ratios, as a surface brush lays
out its surface. Offset, Size and the ratios are animatable.
Deviation (winui-composition.md): what is outside the mapped view box is clipped (the port’s reading of WinUI); a view box whose size is zero maps nothing (the shapes are drawn as if there were no view box).
Implementations§
Source§impl CompositionViewBox
impl CompositionViewBox
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 view box.
pub fn is_disposed(&self) -> bool
pub fn dispose(&self)
Sourcepub fn props(&self) -> &CompositionViewBoxProps
pub fn props(&self) -> &CompositionViewBoxProps
The generated properties of the view box.
Sourcepub fn horizontal_alignment_ratio(&self) -> f32
pub fn horizontal_alignment_ratio(&self) -> f32
The part of the free horizontal space left of the mapped view box (0 left, 0.5 centre, 1 right; default 0.5).
pub fn set_horizontal_alignment_ratio(&self, value: f32)
pub fn set_offset(&self, value: Vector)
pub fn set_size(&self, value: Vector)
Sourcepub fn stretch(&self) -> CompositionStretch
pub fn stretch(&self) -> CompositionStretch
How the view box is scaled onto the visual (default Fill).
pub fn set_stretch(&self, value: CompositionStretch)
Sourcepub fn vertical_alignment_ratio(&self) -> f32
pub fn vertical_alignment_ratio(&self) -> f32
The part of the free vertical space above the mapped view box (0 top, 0.5 centre, 1 bottom; default 0.5).
pub fn set_vertical_alignment_ratio(&self, value: f32)
Trait Implementations§
Source§impl AsCompositionObject for CompositionViewBox
impl AsCompositionObject for CompositionViewBox
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 CompositionViewBoxHooks for CompositionViewBox
impl CompositionViewBoxHooks for CompositionViewBox
fn initialize_defaults_extra(&self)
fn validate_horizontal_alignment_ratio_change( &self, _old_value: f32, _new_value: f32, )
fn on_horizontal_alignment_ratio_changed(&self)
fn on_horizontal_alignment_ratio_changing(&self)
fn validate_offset_change(&self, _old_value: Vector, _new_value: Vector)
fn on_offset_changed(&self)
fn on_offset_changing(&self)
fn validate_size_change(&self, _old_value: Vector, _new_value: Vector)
fn on_size_changed(&self)
fn on_size_changing(&self)
fn validate_stretch_change( &self, _old_value: CompositionStretch, _new_value: CompositionStretch, )
fn on_stretch_changed(&self)
fn on_stretch_changing(&self)
fn validate_vertical_alignment_ratio_change( &self, _old_value: f32, _new_value: f32, )
fn on_vertical_alignment_ratio_changed(&self)
fn on_vertical_alignment_ratio_changing(&self)
Source§impl ICompositionObjectAnimations for CompositionViewBox
impl ICompositionObjectAnimations for CompositionViewBox
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 CompositionViewBox
impl ICompositionObjectHost for CompositionViewBox
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.Source§impl ICompositorSerializable for CompositionViewBox
impl ICompositorSerializable for CompositionViewBox
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 CompositionViewBox
impl !RefUnwindSafe for CompositionViewBox
impl !Send for CompositionViewBox
impl !Sync for CompositionViewBox
impl !UnwindSafe for CompositionViewBox
impl Unpin for CompositionViewBox
impl UnsafeUnpin for CompositionViewBox
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