CompositionGradientBrush
struct · ferroui-base · v0.5.0
struct CompositionGradientBrush
The base of the composition gradient brushes: the gradient stops and the spread method.
Members
from_brushgradient_stopsset_gradient_stopsspread_methodset_spread_methodanchor_pointset_anchor_pointcenter_pointset_center_pointoffsetset_offsetrotation_angleset_rotation_anglescaleset_scaletransform_matrixset_transform_matrixrotation_angle_in_degreesset_rotation_angle_in_degreesextend_modeset_extend_modeinterpolation_spaceset_interpolation_spacemapping_modeset_mapping_modecolor_stopsset_color_stops
from_brush
fn from_brush(brush: &Rc<CompositionBrush>) -> Option<CompositionGradientBrush>
The handle of brush as a gradient brush, if it is one.
gradient_stops
fn gradient_stops(self: &Self) -> FerroList<Rc<dyn IGradientStop>>
The gradient stops. Mutations of the list itself are not tracked - assign
the property to ship in-place edits made after a commit. Stops created via
Compositor::create_gradient_stop_with stay live
on the server and animate individually; other stops are snapshotted at
serialization time.
set_gradient_stops
fn set_gradient_stops(self: &Self, value: FerroList<Rc<dyn IGradientStop>>)
spread_method
fn spread_method(self: &Self) -> GradientSpreadMethod
How the gradient repeats outside the stop range.
set_spread_method
fn set_spread_method(self: &Self, value: GradientSpreadMethod)
anchor_point
fn anchor_point(self: &Self) -> Vector
The point of the gradient, relative to the size of the painted area,
that is placed at offset (animatable as AnchorPoint).
set_anchor_point
fn set_anchor_point(self: &Self, value: Vector)
center_point
fn center_point(self: &Self) -> Vector
The point the gradient is scaled and rotated about, in the
coordinates of the painted area (animatable as CenterPoint).
set_center_point
fn set_center_point(self: &Self, value: Vector)
offset
fn offset(self: &Self) -> Vector
The offset of the gradient (animatable as Offset).
set_offset
fn set_offset(self: &Self, value: Vector)
rotation_angle
fn rotation_angle(self: &Self) -> f32
The rotation of the gradient about its centre point, in radians
(animatable as RotationAngle).
set_rotation_angle
fn set_rotation_angle(self: &Self, value: f32)
scale
fn scale(self: &Self) -> Vector
The scale of the gradient about its centre point (default (1, 1);
animatable as Scale).
set_scale
fn set_scale(self: &Self, value: Vector)
transform_matrix
fn transform_matrix(self: &Self) -> Matrix
The transform matrix of the gradient (WinUI Matrix3x2; animatable
as TransformMatrix).
set_transform_matrix
fn set_transform_matrix(self: &Self, value: Matrix)
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)
extend_mode
fn extend_mode(self: &Self) -> CompositionGradientExtendMode
How the gradient continues outside its stops: a view of
spread_method (Clamp is Pad, Wrap is
Repeat, Mirror is Reflect).
set_extend_mode
fn set_extend_mode(self: &Self, value: CompositionGradientExtendMode)
interpolation_space
fn interpolation_space(self: &Self) -> CompositionColorSpace
The colour space the stops are interpolated in.
Deviation (winui-composition.md): stored only; the drawing contexts interpolate in RGB.
set_interpolation_space
fn set_interpolation_space(self: &Self, value: CompositionColorSpace)
mapping_mode
fn mapping_mode(self: &Self) -> CompositionMappingMode
How the points of the WinUI members are measured (default
Relative). Changing it keeps the numbers of the points and changes
their unit, as WinUI reads the same numbers in the new mode.
set_mapping_mode
fn set_mapping_mode(self: &Self, value: CompositionMappingMode)
color_stops
fn color_stops(self: &Self) -> FerroList<Rc<dyn IGradientStop>>
ColorStops: the WinUI name of
gradient_stops, with the same rule: a change
of the list itself is shipped when the list is assigned again
(set_color_stops).
set_color_stops
fn set_color_stops(self: &Self, value: FerroList<Rc<dyn IGradientStop>>)
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.