← ClaudeAtlas

creating-wpf-brusheslisted

Creates WPF Brush patterns including SolidColorBrush, LinearGradientBrush, RadialGradientBrush, ImageBrush, and VisualBrush. Use when filling shapes with colors, gradients, images, or tile patterns.
christian289/dotnet-with-claudecode · ★ 41 · Data & Documents · score 73
Install: claude install-skill christian289/dotnet-with-claudecode
# WPF Brush Patterns Brush types for filling shapes and backgrounds in WPF. ## 1. Brush Hierarchy ``` Brush (abstract) ├── SolidColorBrush ← Single color ├── GradientBrush │ ├── LinearGradientBrush ← Linear gradient │ └── RadialGradientBrush ← Radial gradient ├── TileBrush │ ├── ImageBrush ← Image fill │ ├── DrawingBrush ← Drawing fill │ └── VisualBrush ← Visual element fill └── BitmapCacheBrush ← Cached visual ``` --- ## 2. SolidColorBrush ```xml <!-- Inline color name --> <Rectangle Fill="Blue"/> <!-- Hex color --> <Rectangle Fill="#FF2196F3"/> <!-- With opacity --> <Rectangle> <Rectangle.Fill> <SolidColorBrush Color="Blue" Opacity="0.5"/> </Rectangle.Fill> </Rectangle> ``` ```csharp // Code creation var brush = new SolidColorBrush(Colors.Blue); brush.Opacity = 0.5; brush.Freeze(); // Performance optimization ``` --- ## 3. LinearGradientBrush ```xml <!-- Horizontal gradient (default) --> <Rectangle Width="200" Height="100"> <Rectangle.Fill> <LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> <GradientStop Color="#2196F3" Offset="0"/> <GradientStop Color="#FF9800" Offset="1"/> </LinearGradientBrush> </Rectangle.Fill> </Rectangle> <!-- Diagonal gradient --> <Rectangle.Fill> <LinearGradientBrush StartPoint="0,0" EndPoint="1,1"> <GradientStop Color="#2196F3" Offset="0"/> <GradientStop Color="#4CAF50" Offset="0.5"/> <GradientStop Color="#