Skip to content

Repository files navigation

Screenshot for Windows

A local screenshot tool built with myzig (Zig + the system WebView2) with global shortcuts, frozen region selection, and a pixel-resolution annotation editor. Images stay in memory until you explicitly copy or save them.

Download and install

Open GitHub Releases, choose a release, expand Assets, and download Screenshot-Setup-<version>-windows-x64.exe. Run the installer and launch Screenshot from its shortcut. Node.js is not required. Windows 10 needs the WebView2 Runtime, which Windows 11 includes. GitHub's Source code ZIP/tar.gz files are not installers.

The installer is for Windows x64 and is currently unsigned, so Windows may show an unknown-publisher warning. Optional integrity check: compare Get-FileHash .\Screenshot-Setup-<version>-windows-x64.exe -Algorithm SHA256 with the accompanying SHA256SUMS.txt. Updates are installed manually from Releases; in-app auto-update is not included.

Publish a release

The Windows release workflow runs when a tag starting with v is pushed. It validates the tag against package.json.version, runs typechecking and unit tests, builds a Windows x64 NSIS installer, and publishes the installer plus its SHA-256 checksum to GitHub Releases. Stable tags produce normal releases; tags such as v0.2.0-beta.1 produce prereleases that are not marked Latest.

  1. Ensure the workflow and release scripts are committed. Update package.json.version to the version being released, for example 0.2.0. Keep the lockfile consistent if dependencies change.
  2. Run pnpm typecheck, pnpm test, and pnpm build; commit the release changes and push the commit.
  3. Create and push the matching tag (replace this example version with your package version):
git tag -a v0.2.0 -m "Release v0.2.0"
git push origin v0.2.0

Use vMAJOR.MINOR.PATCH or a SemVer prerelease, without build metadata. Tag/version mismatches fail before dependency installation. Branch pushes do not publish. Do not move an already published version tag; release a new version instead.

Check Actions → Windows release for progress and failures. Build failures do not publish a release. An upload failure leaves a draft; use Re-run failed jobs to continue it. A complete published release is left unchanged on rerun; a published release missing assets fails for maintainer review rather than replacing public binaries.

Enable GitHub Actions and allow the publish job's contents: write permission under repository/organization policy. The workflow uses the built-in GITHUB_TOKEN; no personal access token is required. The repository must be public for everyone to download without repository access. Code signing is a separate future setup.

Development

Use Windows x64 with Zig 0.17.0, Node 22.12+ (tested with Node 24.21.0) and pnpm 8.15.9. Clone myzig next to this repository (build.zig.zon depends on ../myzig), build its CLI with cd ../myzig/cli && zig build -Doptimize=ReleaseSafe, and put cli/zig-out/bin on the PATH. NSIS makes the installer.

pnpm install --frozen-lockfile
pnpm dev

If PowerShell execution policy blocks pnpm.ps1, use pnpm.cmd for every command.

pnpm typecheck
pnpm test -- tests/geometry.test.ts
pnpm test
pnpm build

pnpm dev runs myzig dev: it starts Vite, builds the Zig app in desktop/ and restarts it when Zig code changes; renderer changes update live. It also regenerates src/myzig.js and src/myzig.d.ts, the client of the Zig service, which are committed so typechecking works without Zig. pnpm test runs Vitest and zig build test. pnpm build creates build/windows-x86_64/Screenshot/Screenshot.exe and an unsigned NSIS installer, Screenshot Setup <version> x86_64.exe, with the frontend embedded in the executable. The version comes from build.zig.zon; keep it equal to package.json's.

Usage

  • Ctrl+Alt+F: capture all connected displays, including taskbars, as one image.
  • Ctrl+Alt+R: drag one region across connected displays. Release on any screen to open the editor; Escape cancels all overlays.
  • Home and tray use the same whole-desktop capture as hotkeys, without a display chooser. Screens are arranged as in Windows, including negative positions and vertical layouts. Gaps remain transparent. Mixed-DPI screens use the highest connected scale factor as the output density; lower-DPI screens are resampled. Maximum: 32 megapixels for the desktop and total source frames, 16384 pixels per output edge; larger configurations report an error before capture.
  • Change shortcuts in Settings by focusing either field and pressing a combination, then Apply. Unavailable shortcuts are rejected and previous registrations restored.
  • Draw straight lines, arrows, rectangles, circles, freehand strokes or blur. Hold Shift for a square. Color and size affect the next stroke; color also updates a selected colored object.
  • Choose Select, click an outline/stroke and press Delete or use the trash button. Blur is selectable and removable.
  • Text: click the image, enter text and choose Done or Ctrl+Enter. Enter adds a line; Escape discards the draft. Double-click existing text in Select to edit it. Text supports 2,000 Unicode code points, 20 lines, and sizes 12–160 image pixels; select it to change color/size or delete it.
  • Emoji: pick an offline emoji, then click the image to place it. Select it to resize (16–256 image pixels) or delete. The palette uses the available colored Segoe UI Emoji glyphs; emoji colors are preserved. Arrow keys navigate the picker; Escape dismisses the picker or pending placement first.
  • Move and resize: choose Select and drag an object or the inside of its selection frame to move it. Drag any of the four corners or four edge handles to resize. This works for arrows, shapes, freehand, blur, Text and Emoji. Shapes/strokes stretch freely; Shift on a corner keeps their ratio. Text/Emoji always keep their ratio and existing size limits. Blur moves its mask onto the new background.
  • Rotate screenshot: click the clockwise arrow on the toolbar to rotate the whole screenshot and its annotations by 90°. Four clicks restore the original orientation. The canvas fits the new dimensions, annotations remain editable, and Copy/Save use the displayed orientation at original pixel resolution. Each new capture starts unrotated.
  • Rotate object: select a line, arrow, rectangle/square, Text or Emoji, then drag the round handle above its frame to rotate freely through 360° in either direction. The angle is shown above the handle; hold Shift to snap to 15° steps. The eight resize handles follow the rotated axes. Text editing and size changes retain the angle. Shapes can rotate past an image edge; preview and output clip the same area.
  • Lines, arrows, rectangles/squares, circles/ellipses and freehand retain a fixed stroke width in original image pixels when resized. Arrowheads are rebuilt symmetrically at the current Size, fitting shorter shafts when necessary; changing Size keeps the rotated shaft in place. Freehand caps, joins and single-point dots stay round. Select an object and use Size to change its stroke thickness. Circles can stretch into ellipses; Shift plus a corner preserves the current ratio. Blur retains its existing mask scaling.
  • Release the mouse to apply a move/resize/rotation. Escape, interrupted pointer capture or resizing the editor window discards the current drag. Copy/Save and tool changes are disabled during dragging. Selection handles keep their on-screen size at any zoom and are excluded from exported images.
  • Escape first discards an in-progress stroke, otherwise closes the capture. Copy/Save keep the editor open.
  • Closing Settings leaves the app in the system tray. Right-click the tray icon to capture, open Settings, or Quit.

Annotations remain in original image pixels regardless of zoom. Blur uses a cached blurred original and a union of stroke masks; colored annotations are always above blur. Preview and PNG export share one renderer, while selection decoration is preview-only.

Structure and privacy

desktop/ is the Zig app: Win32 display capture, the multi-display composite, windows, tray, global shortcuts, native dialogs, clipboard and persistence. src/bridge.ts adapts the generated myzig client to the ScreenshotAPI in shared/, which also holds coordinate validation. src/stores/editor.ts owns editor state through Zustand; components import useEditor and select the state/actions they need. src/editor/ contains geometry, hit testing and Canvas rendering. React Context is not used for application state.

Only shortcut settings and the last successful save directory are stored in %AppData%\Screenshot\settings.json. Capture images are not logged, uploaded, or written to temporary files. Dev/test tooling may explicitly produce screenshots as QA artifacts. The bound Zig service has no generic filesystem, command execution, or arbitrary event-channel API.

See Windows QA for validation evidence and outstanding hardware checks. The Electron Playwright E2E suite was removed with Electron; native capture, shortcuts and dialogs currently need manual QA.

Insert image

Use Insert image on the editor toolbar to choose a local PNG, JPG/JPEG, SVG or WebP. The image becomes a separate selectable object above the screenshot. Drag it to move, use its eight handles to resize, or use the rotation handle for 360-degree rotation (Shift snaps to 15 degrees). Shift plus a corner resize preserves the current aspect ratio. W/H accept original-image pixel dimensions; their aspect-ratio lock starts enabled. Delete removes the selected image. Copy and Save include inserted images and keep transparent pixels.

WebP/APNG animation is imported as its first frame. JPEG EXIF orientation is applied. SVG support covers static, self-contained shapes, paths, text, gradients, clip paths, masks and internal use references. Scripts, animation, stylesheets, filters, foreignObject, embedded images and external resources are rejected; export text to paths when a particular font must be preserved. SVG is an image object, not an editable path collection. Save still produces a flattened PNG.

Imports are limited to 20 MiB per file, 24 megapixels and 16384 pixels per edge, with a 128 MiB decoded-image/cache budget. SVG additionally has XML size, element, depth and reference-expansion limits. Images and caches remain in memory and are released on delete or session close. Blur continues to affect the original screenshot, not inserted image layers.

The editor header uses two tool rows without horizontal scrolling: drawing tools above, object properties and image actions below. Copy/Save/Cancel stay at the top right as icon buttons with tooltips. Successful Copy/Save messages appear in bold green at the bottom right.