FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    from_brush

    fn from_brush(brush: &Rc<CompositionBrush>) -> Option<CompositionSurfaceBrush>
    

    The handle of brush as a surface brush, if it is one.

    Source

    surface

    fn surface(self: &Self) -> Option<Rc<dyn ICompositionSurface>>
    

    The surface the brush paints.

    Source

    set_surface

    fn set_surface(self: &Self, value: Option<Rc<dyn ICompositionSurface>>)
    

    Source

    stretch

    fn stretch(self: &Self) -> CompositionStretch
    

    How the surface is sized in the area of the brush (default Fill).

    Source

    set_stretch

    fn set_stretch(self: &Self, value: CompositionStretch)
    

    Source

    horizontal_alignment_ratio

    fn horizontal_alignment_ratio(self: &Self) -> f32
    

    Where the surface is placed horizontally: 0 left, 0.5 centred (default), 1 right.

    Source

    set_horizontal_alignment_ratio

    fn set_horizontal_alignment_ratio(self: &Self, value: f32)
    

    Source

    vertical_alignment_ratio

    fn vertical_alignment_ratio(self: &Self) -> f32
    

    Where the surface is placed vertically: 0 top, 0.5 centred (default), 1 bottom.

    Source

    set_vertical_alignment_ratio

    fn set_vertical_alignment_ratio(self: &Self, value: f32)
    

    Source

    bitmap_interpolation_mode

    fn bitmap_interpolation_mode(self: &Self) -> CompositionBitmapInterpolationMode
    

    How a bitmap surface is resampled (default Linear).

    Source

    set_bitmap_interpolation_mode

    fn set_bitmap_interpolation_mode(self: &Self, value: CompositionBitmapInterpolationMode)
    

    Source

    anchor_point

    fn anchor_point(self: &Self) -> Vector
    

    The point of the content, relative to the area of the brush, placed at offset.

    Source

    set_anchor_point

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

    Source

    center_point

    fn center_point(self: &Self) -> Vector
    

    The point the content is scaled and rotated about.

    Source

    set_center_point

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

    Source

    offset

    fn offset(self: &Self) -> Vector
    

    The offset of the content.

    Source

    set_offset

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

    Source

    rotation_angle

    fn rotation_angle(self: &Self) -> f32
    

    The rotation of the content about its center point, in radians.

    Source

    set_rotation_angle

    fn set_rotation_angle(self: &Self, value: f32)
    

    Source

    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).

    Source

    set_rotation_angle_in_degrees

    fn set_rotation_angle_in_degrees(self: &Self, value: f32)
    

    Source

    scale

    fn scale(self: &Self) -> Vector
    

    The scale of the content about its center point (default (1, 1)).

    Source

    set_scale

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

    Source

    transform_matrix

    fn transform_matrix(self: &Self) -> Matrix
    

    The transform matrix of the content (WinUI Matrix3x2).

    Source

    set_transform_matrix

    fn set_transform_matrix(self: &Self, value: Matrix)
    

    Source

    snap_to_pixels

    fn snap_to_pixels(self: &Self) -> bool
    

    Whether the content is aligned to device pixels.

    Source

    set_snap_to_pixels

    fn set_snap_to_pixels(self: &Self, value: bool)
    

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Receiver
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Deref

    Availability

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