Drawing & Painting in Wisej.NET
Seven runnable Wisej.NET 4 applications following the course specifications, lesson guides, lab steps and walkthroughs. Each module is a cumulative snapshot of VisualOperationsStudio, a plant operations screen that renders the same telemetry on four different surfaces. The final module is the capstone.
The modules
| Module | What it builds |
|---|---|
| 1 · The Wisej.NET Drawing Architecture | One TelemetrySample on four surfaces at once: a Label and a ProgressBar, a Panel.Paint handler, a Wisej.Web.Canvas driven by Redraw, and an off-screen Bitmap from Graphics.FromImage. |
| 2 · Mastering the Control Paint Event | A reusable TelemetryGauge — ring, threshold zones, needle, value, caption — with clamping setters that repaint once, and all the coordinate maths in a pure GaugeGeometry. |
| 3 · DataGridView Cell Painting | An operations grid of 1,000 machines with UserPaint on the Health and Trend columns, one guarded CellPaint handler, and an AllowHtml status column beside them for comparison. |
| 4 · Canvas and the HTML5 2D Model | A Canvas playground: paths, fills, a placed caption, linear and radial gradients, four transform blocks inside Save/Restore, and a clip, alpha, dash and shadow section. |
| 5 · Interactive Canvas and Hit Testing | The playground becomes a topology editor: a per-session TopologyScene, world↔screen conversions, hit testing, drag, pan, zoom about the pointer, culling and a keyboard path. |
| 6 · System.Drawing.Managed and Cross-Platform Rendering | A TopologyImageRenderer that turns the same model into PNG bytes with no control and no session, with a font fallback chain and a bounded output size. |
| 7 · Production Drawing Architecture and Capstone | One OperationsModel behind all four surfaces, a shared geometry layer, RenderMetrics, one measured optimisation, four executed degraded paths, an accessible values table and 22 geometry tests. |
Run a module
Requirements: .NET 10 SDK, NuGet access to Wisej-4 4.1.0 and a Wisej development license or trial.
Open a module's VisualOperationsStudio.slnx in Visual Studio and press F5, or run:
cd "Drawing and Painting Course/Module 7/VisualOperationsStudio"
dotnet run -f net10.0 --urls http://localhost:6007
Each project targets net10.0-windows and net10.0, so the CLI needs -f. Ports 6001–6007 let the
snapshots run side by side. Nothing requires a database, a third-party service or a deployment.
The capstone's geometry tests run from Module 7 and need no Wisej session, licence or browser:
cd "Drawing and Painting Course/Module 7"
dotnet test VisualOperationsStudio.Tests/VisualOperationsStudio.Tests.csproj
Conventions
- Designer-style
.Designer.csfiles hold the named controls; short handlers and helpers live in the code-behind, in the same folders the labs name:Models,Geometry,Controls,Renderers,Diagnostics. - Every surface reads the model. No renderer keeps a copy of a value, and from Module 7 there is exactly
one
OperationsModelper session behind all four. - The coordinate maths lives in
Geometryand references noGraphics, no control and no session, which is what makes it testable. - Painted surfaces fill in over the first seconds after a page opens; that is how Wisej.NET delivers them, not a fault in the sample.
- Every session owns its own model. Nothing is persisted.