rendering-mewui-elements

Solid

Renders custom graphics in MewUI controls using IGraphicsContext. Use when implementing OnRender, drawing shapes, text, images, or understanding the Measure/Arrange/Render pipeline.

Web & Frontend 40 stars 6 forks Updated 6 days ago MIT

Install

View on GitHub

Quality Score: 81/100

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

Skill Content

## Rendering Pipeline MewUI uses a three-pass layout system: ``` Measure (calculate DesiredSize) → Arrange (set Bounds) → Render (draw via IGraphicsContext) ``` **Key overrides in custom controls:** - `MeasureContent(Size availableSize)` → return desired size - `ArrangeContent(Rect bounds)` → position children - `OnRender(IGraphicsContext context)` → draw visuals --- ## IGraphicsContext Essentials ```csharp protected override void OnRender(IGraphicsContext context) { var bounds = new Rect(0, 0, Bounds.Width, Bounds.Height); // State management (always Save/Restore) context.Save(); context.Translate(10, 10); context.SetClip(clipRect); // ... drawing ... context.Restore(); // Drawing primitives context.FillRectangle(bounds, Colors.Blue); context.DrawRectangle(bounds, Colors.Black, thickness: 1); context.FillRoundedRectangle(bounds, radiusX: 4, radiusY: 4, Colors.White); context.DrawLine(start, end, Colors.Gray, thickness: 1); context.FillEllipse(bounds, Colors.Red); // Text - note parameter order: text, bounds, font, color, alignments, wrapping context.DrawText("Hello", bounds, font, Colors.Black, TextAlignment.Center, TextAlignment.Center, TextWrapping.NoWrap); // Images context.DrawImage(image, destRect); } ``` --- ## Text Measurement ```csharp protected override Size MeasureContent(Size availableSize) { var factory = GetGraphicsFactory(); using var ctx = factory.CreateMeasurement...

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