pub struct CompositionLinearGradientBrush(/* private fields */);Expand description
A composition brush that paints with a linear gradient.
Implementations§
Source§impl CompositionLinearGradientBrush
impl CompositionLinearGradientBrush
Sourcepub fn from_brush(
brush: &Rc<CompositionBrush>,
) -> Option<CompositionLinearGradientBrush>
pub fn from_brush( brush: &Rc<CompositionBrush>, ) -> Option<CompositionLinearGradientBrush>
The handle of brush as this class, if it is one.
Source§impl CompositionLinearGradientBrush
impl CompositionLinearGradientBrush
pub fn start_point(&self) -> RelativePoint
pub fn set_start_point(&self, value: RelativePoint)
pub fn end_point(&self) -> RelativePoint
pub fn set_end_point(&self, value: RelativePoint)
Source§impl CompositionLinearGradientBrush
impl CompositionLinearGradientBrush
Sourcepub fn start_point_vector(&self) -> Vector
pub fn start_point_vector(&self) -> Vector
StartPoint as a WinUI Vector2, in the unit of the mapping mode
(default (0, 0)). The upstream member is
start_point.
Deviation (winui-composition.md): animations target the upstream
StartPoint (a relative point), not a Vector2.
pub fn set_start_point_vector(&self, value: Vector)
Sourcepub fn end_point_vector(&self) -> Vector
pub fn end_point_vector(&self) -> Vector
EndPoint as a WinUI Vector2, in the unit of the mapping mode.
Deviation (winui-composition.md): the default is the one of the
upstream brush, (0, 0), not the (1, 0) of WinUI.
pub fn set_end_point_vector(&self, value: Vector)
Methods from Deref<Target = CompositionGradientBrush>§
Sourcepub fn gradient_stops(&self) -> FerroList<Rc<dyn IGradientStop>>
pub fn gradient_stops(&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.
pub fn set_gradient_stops(&self, value: FerroList<Rc<dyn IGradientStop>>)
Sourcepub fn spread_method(&self) -> GradientSpreadMethod
pub fn spread_method(&self) -> GradientSpreadMethod
How the gradient repeats outside the stop range.
pub fn set_spread_method(&self, value: GradientSpreadMethod)
Sourcepub fn anchor_point(&self) -> Vector
pub fn anchor_point(&self) -> Vector
The point of the gradient, relative to the size of the painted area,
that is placed at offset (animatable as AnchorPoint).
pub fn set_anchor_point(&self, value: Vector)
Sourcepub fn center_point(&self) -> Vector
pub fn center_point(&self) -> Vector
The point the gradient is scaled and rotated about, in the
coordinates of the painted area (animatable as CenterPoint).
pub fn set_center_point(&self, value: Vector)
pub fn set_offset(&self, value: Vector)
Sourcepub fn rotation_angle(&self) -> f32
pub fn rotation_angle(&self) -> f32
The rotation of the gradient about its centre point, in radians
(animatable as RotationAngle).
pub fn set_rotation_angle(&self, value: f32)
Sourcepub fn scale(&self) -> Vector
pub fn scale(&self) -> Vector
The scale of the gradient about its centre point (default (1, 1);
animatable as Scale).
pub fn set_scale(&self, value: Vector)
Sourcepub fn transform_matrix(&self) -> Matrix
pub fn transform_matrix(&self) -> Matrix
The transform matrix of the gradient (WinUI Matrix3x2; animatable
as TransformMatrix).
pub fn set_transform_matrix(&self, value: Matrix)
Sourcepub fn rotation_angle_in_degrees(&self) -> f32
pub fn rotation_angle_in_degrees(&self) -> f32
The rotation in degrees: a view of
rotation_angle (not an animation target).
pub fn set_rotation_angle_in_degrees(&self, value: f32)
Sourcepub fn extend_mode(&self) -> CompositionGradientExtendMode
pub fn extend_mode(&self) -> CompositionGradientExtendMode
How the gradient continues outside its stops: a view of
spread_method (Clamp is Pad, Wrap is
Repeat, Mirror is Reflect).
pub fn set_extend_mode(&self, value: CompositionGradientExtendMode)
Sourcepub fn interpolation_space(&self) -> CompositionColorSpace
pub fn interpolation_space(&self) -> CompositionColorSpace
The colour space the stops are interpolated in.
Deviation (winui-composition.md): stored only; the drawing contexts interpolate in RGB.
pub fn set_interpolation_space(&self, value: CompositionColorSpace)
Sourcepub fn mapping_mode(&self) -> CompositionMappingMode
pub fn mapping_mode(&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.
pub fn set_mapping_mode(&self, value: CompositionMappingMode)
Sourcepub fn color_stops(&self) -> FerroList<Rc<dyn IGradientStop>>
pub fn color_stops(&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).
pub fn set_color_stops(&self, value: FerroList<Rc<dyn IGradientStop>>)
Trait Implementations§
Source§impl Deref for CompositionLinearGradientBrush
impl Deref for CompositionLinearGradientBrush
Source§type Target = CompositionGradientBrush
type Target = CompositionGradientBrush
Source§fn deref(&self) -> &CompositionGradientBrush
fn deref(&self) -> &CompositionGradientBrush
Auto Trait Implementations§
impl !RefUnwindSafe for CompositionLinearGradientBrush
impl !Send for CompositionLinearGradientBrush
impl !Sync for CompositionLinearGradientBrush
impl !UnwindSafe for CompositionLinearGradientBrush
impl Freeze for CompositionLinearGradientBrush
impl Unpin for CompositionLinearGradientBrush
impl UnsafeUnpin for CompositionLinearGradientBrush
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