Skip to main content

CompositionNineGridBrush

Struct CompositionNineGridBrush 

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

A brush that paints another brush stretched as a nine-grid (WinUI Microsoft.UI.Composition.CompositionNineGridBrush): the source is cut by its four insets into corners, edges and a centre; the corners keep their size (the insets times the inset scales), the edges stretch along one axis, the centre along both.

The source is a colour or gradient brush (the nine regions of the area are filled with it, the frame only when the centre is hollow) or a CompositionSurfaceBrush, whose surface is cut at its natural size: the insets are in the units of the natural size of the surface. The insets and inset scales are animatable.

Deviation (winui-composition.md): the stretch, alignment and transform of a surface brush source are not applied; its surface is cut as it is.

Implementations§

Source§

impl CompositionNineGridBrush

Source

pub fn left_inset(&self) -> f32

The width of the left column of the source (animatable as LeftInset).

Source

pub fn set_left_inset(&self, value: f32)

Source

pub fn top_inset(&self) -> f32

The height of the top row of the source (animatable as TopInset).

Source

pub fn set_top_inset(&self, value: f32)

Source

pub fn right_inset(&self) -> f32

The width of the right column of the source (animatable as RightInset).

Source

pub fn set_right_inset(&self, value: f32)

Source

pub fn bottom_inset(&self) -> f32

The height of the bottom row of the source (animatable as BottomInset).

Source

pub fn set_bottom_inset(&self, value: f32)

Source

pub fn left_inset_scale(&self) -> f32

The scale of the left inset in the painted area (default 1; animatable as LeftInsetScale).

Source

pub fn set_left_inset_scale(&self, value: f32)

Source

pub fn top_inset_scale(&self) -> f32

The scale of the top inset in the painted area (default 1).

Source

pub fn set_top_inset_scale(&self, value: f32)

Source

pub fn right_inset_scale(&self) -> f32

The scale of the right inset in the painted area (default 1).

Source

pub fn set_right_inset_scale(&self, value: f32)

Source

pub fn bottom_inset_scale(&self) -> f32

The scale of the bottom inset in the painted area (default 1).

Source

pub fn set_bottom_inset_scale(&self, value: f32)

Source§

impl CompositionNineGridBrush

Source

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

The handle of brush as a nine-grid brush, if it is one.

Source

pub fn props(&self) -> &CompositionNineGridBrushProps

The generated properties of the brush.

Source

pub fn source(&self) -> Option<Rc<CompositionBrush>>

The brush that is cut into nine regions.

Source

pub fn set_source(&self, value: Option<Rc<CompositionBrush>>)

Source

pub fn is_center_hollow(&self) -> bool

Whether the centre region is left unpainted.

Source

pub fn set_is_center_hollow(&self, value: bool)

Source

pub fn set_insets(&self, inset: f32)

SetInsets(inset): the four insets.

Source

pub fn set_insets_with(&self, left: f32, top: f32, right: f32, bottom: f32)

SetInsets(left, top, right, bottom).

Source

pub fn set_inset_scales(&self, scale: f32)

SetInsetScales(scale): the four inset scales.

Source

pub fn set_inset_scales_with( &self, left: f32, top: f32, right: f32, bottom: f32, )

SetInsetScales(left, top, right, bottom).

Trait Implementations§

Source§

impl Clone for CompositionNineGridBrush

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 CompositionNineGridBrush

Source§

type Target = Rc<CompositionBrush>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Rc<CompositionBrush>

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.