Skip to content

SmrtHub WinUI3 DPI Discipline (Authoritative Extract)

Status: Active Owner: Platform / UI Engineering

This page is the in-site copy of the authoritative README in README.Files/SmrtHub-WinUI3-DPI-Discipline.README.md.

Core Discipline

  • Declare only x64 platform; no AnyCPU WinUI packaging builds.
  • Use vector (SVG / Path) assets where possible; raster only when pixel-fitted.
  • Enforce consistent scaling logic – never mix raw pixel sizes with effective DPI without explicit conversion.

Layout & Scaling Rules

  1. Use DisplayInformation (or WinUI3 equivalent) to query scale; convert asset pixel dimensions using that factor.
  2. Minimum interaction target: 32x32 effective pixels (after scale) for pointer-friendly controls.
  3. Do not round intermediate layout calculations down; round to nearest to reduce cumulative drift.
  4. Avoid fixed pixel sizes in styles; prefer resource tokens referencing scale-aware helpers.

Assets & DPI

  • UI icons: keep a single SVG authoring source, but render as XAML geometry (PathIconSource) so icons tint cleanly across theme + state.
  • Only produce raster fallbacks for shell/tray icons (multi-size .ico).
  • Logo: supply SVG + a few tuned raster fallbacks (48, 128, 256) if clarity requires.

Testing Checklist

Check Tooling
High-DPI text crisp Manual at 150/200%
SVG icons sharp Visual + pixel zoom
No double-scaling Inspect transforms
Interaction targets >= 32px UI inspection
No clipped layout at 125/175% Resize test

(For full rationale and edge cases consult the root README copy.)