Skip to main content

CompositionLinearGradientBrush

Struct CompositionLinearGradientBrush 

Source
pub struct CompositionLinearGradientBrush(/* private fields */);
Expand description

A composition brush that paints with a linear gradient.

Implementations§

Source§

impl CompositionLinearGradientBrush

Source

pub fn from_brush( brush: &Rc<CompositionBrush>, ) -> Option<CompositionLinearGradientBrush>

The handle of brush as this class, if it is one.

Source§

impl CompositionLinearGradientBrush

Source§

impl CompositionLinearGradientBrush

Source

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.

Source

pub fn set_start_point_vector(&self, value: Vector)

Source

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.

Source

pub fn set_end_point_vector(&self, value: Vector)

Methods from Deref<Target = CompositionGradientBrush>§

Source

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.

Source

pub fn set_gradient_stops(&self, value: FerroList<Rc<dyn IGradientStop>>)

Source

pub fn spread_method(&self) -> GradientSpreadMethod

How the gradient repeats outside the stop range.

Source

pub fn set_spread_method(&self, value: GradientSpreadMethod)

Source

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

Source

pub fn set_anchor_point(&self, value: Vector)

Source

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

Source

pub fn set_center_point(&self, value: Vector)

Source

pub fn offset(&self) -> Vector

The offset of the gradient (animatable as Offset).

Source

pub fn set_offset(&self, value: Vector)

Source

pub fn rotation_angle(&self) -> f32

The rotation of the gradient about its centre point, in radians (animatable as RotationAngle).

Source

pub fn set_rotation_angle(&self, value: f32)

Source

pub fn scale(&self) -> Vector

The scale of the gradient about its centre point (default (1, 1); animatable as Scale).

Source

pub fn set_scale(&self, value: Vector)

Source

pub fn transform_matrix(&self) -> Matrix

The transform matrix of the gradient (WinUI Matrix3x2; animatable as TransformMatrix).

Source

pub fn set_transform_matrix(&self, value: Matrix)

Source

pub fn rotation_angle_in_degrees(&self) -> f32

The rotation in degrees: a view of rotation_angle (not an animation target).

Source

pub fn set_rotation_angle_in_degrees(&self, value: f32)

Source

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

Source

pub fn set_extend_mode(&self, value: CompositionGradientExtendMode)

Source

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.

Source

pub fn set_interpolation_space(&self, value: CompositionColorSpace)

Source

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.

Source

pub fn set_mapping_mode(&self, value: CompositionMappingMode)

Source

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

Source

pub fn set_color_stops(&self, value: FerroList<Rc<dyn IGradientStop>>)

Trait Implementations§

Source§

impl Clone for CompositionLinearGradientBrush

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Deref for CompositionLinearGradientBrush

Source§

type Target = CompositionGradientBrush

The resulting type after dereferencing.
Source§

fn deref(&self) -> &CompositionGradientBrush

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.