Skip to main content

Module brushes

Module brushes 

Source
Expand description

Code-built brushes and effects: construct Brush / Effect objects from Rust and paint elements with them without authoring XAML.

Each type here is an owning handle over a freshly-created Noesis object holding a single +1 reference, released on Drop. Same pattern as crate::binding::Boxed / crate::binding::ObservableCollection. Assigning a brush/effect to an element makes Noesis take its own reference, so the Rust handle may be dropped right after assignment. The ergonomic way to assign is the typed sugar on FrameworkElement (set_background / set_foreground / set_fill / set_effect), which routes through the generic set_component DP path.

Read-back getters (SolidColorBrush::color, BlurEffect::radius, …) re-read from the live Noesis object, so they reflect its current state rather than a Rust-side cache.

Structs§

BlurEffect
A BlurEffect blurring an element’s visual by a Radius (in DIPs).
DropShadowEffect
A DropShadowEffect casting a colored shadow behind an element’s visual.
DropShadowParams
Read-back of a DropShadowEffect’s parameters.
GradientStop
A single gradient stop: a color at a normalized offset (0..=1).
ImageBrush
An ImageBrush tiling/stretching an ImageSource over the painted area.
LinearGradientBrush
A LinearGradientBrush painting a gradient along the line from StartPoint to EndPoint (default (0,0)..(1,1), relative to the painted area).
LinearGradientBrushBuilder
Fluent builder for a LinearGradientBrush: set the start/end points, spread method and mapping mode, append .stop(..)s, then build.
RadialGradientBrush
A RadialGradientBrush painting a gradient from a focal GradientOrigin outward to the circle defined by Center + RadiusX/RadiusY.
RadialGradientBrushBuilder
Fluent builder for a RadialGradientBrush: set the center, gradient origin, radii, spread method and mapping mode, append .stop(..)s, then build.
SolidColorBrush
A SolidColorBrush painting a flat [r, g, b, a] color (each 0..=1).
VisualBrush
A VisualBrush painting an area with a Visual. Any element (a FrameworkElement) is a Visual.

Enums§

AlignmentX
Noesis::AlignmentX: horizontal alignment of a tile’s content within its base tile. Ordinals match the C++ enum.
AlignmentY
Noesis::AlignmentY: vertical alignment of a tile’s content within its base tile. Ordinals match the C++ enum.
BrushMappingMode
Noesis::BrushMappingMode: whether a Viewport/Viewbox Rect is in absolute coordinates or relative to the bounding box. Ordinals match the C++ enum.
GradientSpreadMethod
Noesis::GradientSpreadMethod: how a gradient paints the area outside its [0, 1] gradient vector. Ordinals match the C++ enum.
Stretch
Noesis::Stretch: how content is resized to fill its allocated space. Ordinals match the C++ enum.
TileMode
Noesis::TileMode: how a base tile repeats to fill the painted area. Ordinals match the C++ enum.

Traits§

Brush
A handle to a Noesis Brush. Implemented by every brush type in this module so the typed element sugar (e.g. FrameworkElement::set_background) accepts any of them while keeping non-brush objects out.
Effect
A handle to a Noesis Effect (post-process applied to an element’s visual).
TileBrush
The tiling knobs common to every TileBrush (the base of both ImageBrush and VisualBrush): content alignment, stretch, tile mode, and the Viewport/Viewbox Rects with their mapping units.