CompositionSurfaceBrush
struct · ferroui-base · v0.5.0
struct CompositionSurfaceBrush
A composition brush that paints a surface (WinUI
Microsoft.UI.Composition.CompositionSurfaceBrush): a
LoadedImageSurface,
a CompositionVisualSurface
or a CompositionSurface.
The surface is laid out at its natural size in the area of the brush by
stretch and the alignment ratios, transformed by the transform of the
brush (AnchorPoint, CenterPoint, Offset, RotationAngle, Scale,
TransformMatrix, relative to the area) and clipped to the area. The
alignment ratios and the transform members are animatable.
It is painted by the visuals that show it (a sprite visual); it is not a
brush of the drawing context, so it cannot fill the shapes of a drawing
context. The Opacity of the composition brushes applies; their
Transform and RelativeTransform do not.
Members
from_brushsurfaceset_surfacestretchset_stretchhorizontal_alignment_ratioset_horizontal_alignment_ratiovertical_alignment_ratioset_vertical_alignment_ratiobitmap_interpolation_modeset_bitmap_interpolation_modeanchor_pointset_anchor_pointcenter_pointset_center_pointoffsetset_offsetrotation_angleset_rotation_anglerotation_angle_in_degreesset_rotation_angle_in_degreesscaleset_scaletransform_matrixset_transform_matrixsnap_to_pixelsset_snap_to_pixels
from_brush
fn from_brush(brush: &Rc<CompositionBrush>) -> Option<CompositionSurfaceBrush>
The handle of brush as a surface brush, if it is one.
surface
fn surface(self: &Self) -> Option<Rc<dyn ICompositionSurface>>
The surface the brush paints.
set_surface
fn set_surface(self: &Self, value: Option<Rc<dyn ICompositionSurface>>)
stretch
fn stretch(self: &Self) -> CompositionStretch
How the surface is sized in the area of the brush (default Fill).
set_stretch
fn set_stretch(self: &Self, value: CompositionStretch)
horizontal_alignment_ratio
fn horizontal_alignment_ratio(self: &Self) -> f32
Where the surface is placed horizontally: 0 left, 0.5 centred (default), 1 right.
set_horizontal_alignment_ratio
fn set_horizontal_alignment_ratio(self: &Self, value: f32)
vertical_alignment_ratio
fn vertical_alignment_ratio(self: &Self) -> f32
Where the surface is placed vertically: 0 top, 0.5 centred (default), 1 bottom.
set_vertical_alignment_ratio
fn set_vertical_alignment_ratio(self: &Self, value: f32)
bitmap_interpolation_mode
fn bitmap_interpolation_mode(self: &Self) -> CompositionBitmapInterpolationMode
How a bitmap surface is resampled (default Linear).
set_bitmap_interpolation_mode
fn set_bitmap_interpolation_mode(self: &Self, value: CompositionBitmapInterpolationMode)
anchor_point
fn anchor_point(self: &Self) -> Vector
The point of the content, relative to the area of the brush, placed
at offset.
set_anchor_point
fn set_anchor_point(self: &Self, value: Vector)
center_point
fn center_point(self: &Self) -> Vector
The point the content is scaled and rotated about.
set_center_point
fn set_center_point(self: &Self, value: Vector)
offset
fn offset(self: &Self) -> Vector
The offset of the content.
set_offset
fn set_offset(self: &Self, value: Vector)
rotation_angle
fn rotation_angle(self: &Self) -> f32
The rotation of the content about its center point, in radians.
set_rotation_angle
fn set_rotation_angle(self: &Self, value: f32)
rotation_angle_in_degrees
fn rotation_angle_in_degrees(self: &Self) -> f32
The rotation in degrees: a view of
rotation_angle (not an animation target).
set_rotation_angle_in_degrees
fn set_rotation_angle_in_degrees(self: &Self, value: f32)
scale
fn scale(self: &Self) -> Vector
The scale of the content about its center point (default (1, 1)).
set_scale
fn set_scale(self: &Self, value: Vector)
transform_matrix
fn transform_matrix(self: &Self) -> Matrix
The transform matrix of the content (WinUI Matrix3x2).
set_transform_matrix
fn set_transform_matrix(self: &Self, value: Matrix)
snap_to_pixels
fn snap_to_pixels(self: &Self) -> bool
Whether the content is aligned to device pixels.
set_snap_to_pixels
fn set_snap_to_pixels(self: &Self, value: bool)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyToOwnedErasedDestructorIntoEitherCloneDeref
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.