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§
- Blur
Effect - A
BlurEffectblurring an element’s visual by aRadius(in DIPs). - Drop
Shadow Effect - A
DropShadowEffectcasting a colored shadow behind an element’s visual. - Drop
Shadow Params - Read-back of a
DropShadowEffect’s parameters. - Gradient
Stop - A single gradient stop: a color at a normalized
offset(0..=1). - Image
Brush - An
ImageBrushtiling/stretching anImageSourceover the painted area. - Linear
Gradient Brush - A
LinearGradientBrushpainting a gradient along the line fromStartPointtoEndPoint(default(0,0)..(1,1), relative to the painted area). - Linear
Gradient Brush Builder - Fluent builder for a
LinearGradientBrush: set the start/end points, spread method and mapping mode, append.stop(..)s, thenbuild. - Radial
Gradient Brush - A
RadialGradientBrushpainting a gradient from a focalGradientOriginoutward to the circle defined byCenter+RadiusX/RadiusY. - Radial
Gradient Brush Builder - Fluent builder for a
RadialGradientBrush: set the center, gradient origin, radii, spread method and mapping mode, append.stop(..)s, thenbuild. - Solid
Color Brush - A
SolidColorBrushpainting a flat[r, g, b, a]color (each0..=1). - Visual
Brush - A
VisualBrushpainting an area with aVisual. Any element (aFrameworkElement) 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.- Brush
Mapping Mode Noesis::BrushMappingMode: whether aViewport/ViewboxRect is in absolute coordinates or relative to the bounding box. Ordinals match the C++ enum.- Gradient
Spread Method 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.- Tile
Mode 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). - Tile
Brush - The tiling knobs common to every
TileBrush(the base of bothImageBrushandVisualBrush): content alignment, stretch, tile mode, and theViewport/ViewboxRects with their mapping units.