creating-graphics-in-code

Solid

Creates WPF graphics dynamically in C# code using Shape, PathGeometry, and PathFigure classes. Use when building charts, diagrams, or procedurally generated graphics.

Web & Frontend 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

# Creating WPF Graphics in Code Programmatically create shapes and geometry for dynamic graphics. ## 1. Shape Factory Pattern ```csharp namespace MyApp.Graphics; using System.Windows; using System.Windows.Media; using System.Windows.Shapes; public static class ShapeFactory { /// <summary> /// Create circular marker /// </summary> public static Ellipse CreateCircle(double size, Brush fill, Brush? stroke = null) { var ellipse = new Ellipse { Width = size, Height = size, Fill = fill }; if (stroke is not null) { ellipse.Stroke = stroke; ellipse.StrokeThickness = 1; } return ellipse; } /// <summary> /// Create rectangle with optional corner radius /// </summary> public static Rectangle CreateRectangle( double width, double height, Brush fill, double cornerRadius = 0) { return new Rectangle { Width = width, Height = height, Fill = fill, RadiusX = cornerRadius, RadiusY = cornerRadius }; } /// <summary> /// Create line between two points /// </summary> public static Line CreateLine(Point start, Point end, Brush stroke, double thickness = 1) { return new Line { X1 = start.X, Y1 = start.Y, X2 = end.X, Y2 = end.Y, ...

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