implementing-2d-graphics

Solid

Implements WPF 2D graphics using Shape, Geometry, Brush, and Pen classes. Use when building vector graphic UIs, icons, charts, or diagrams in WPF applications.

AI & Automation 40 stars 6 forks Updated 6 days ago MIT

Install

View on GitHub

Quality Score: 78/100

Stars 20%
54
Recency 20%
100
Frontmatter 20%
40
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# WPF 2D Graphics Patterns Implement vector-based visual elements using WPF's 2D graphics system. ## 1. Graphics Hierarchy ``` UIElement └── Shape (FrameworkElement) ← Participates in layout, supports events ├── Ellipse ├── Rectangle ├── Line ├── Polyline ├── Polygon └── Path Drawing ← Lightweight, no events ├── GeometryDrawing ├── ImageDrawing ├── VideoDrawing └── GlyphRunDrawing ``` --- ## 2. Shape Basics ### 2.1 Basic Shapes ```xml <!-- Ellipse --> <Ellipse Width="100" Height="100" Fill="Blue" Stroke="Black" StrokeThickness="2"/> <!-- Rectangle --> <Rectangle Width="100" Height="50" Fill="Red" Stroke="Black" StrokeThickness="1" RadiusX="10" RadiusY="10"/> <!-- Line --> <Line X1="0" Y1="0" X2="100" Y2="100" Stroke="Green" StrokeThickness="3"/> <!-- Polyline (connected lines) --> <Polyline Points="0,0 50,50 100,0 150,50" Stroke="Purple" StrokeThickness="2" Fill="Transparent"/> <!-- Polygon (closed shape) --> <Polygon Points="50,0 100,100 0,100" Fill="Yellow" Stroke="Orange" StrokeThickness="2"/> ``` ### 2.2 Path and Geometry ```xml <!-- Path: complex shapes --> <Path Fill="LightBlue" Stroke="DarkBlue" StrokeThickness="2"> <Path.Data> <PathGeometry> <PathFigure StartPoint="10,10" IsClosed="True"> <LineSegment Point="100,10"/> ...

Details

Author
christian289
Repository
christian289/dotnet-with-claudecode
Created
7 months ago
Last Updated
6 days ago
Language
C#
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category