Skip to content

Walkdao/On-Screen-Drawing-Tool

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

On Screen Drawing Tool

AutoHotkey Platform License Version

GitHub stars GitHub forks GitHub issues Downloads

Lightweight on-screen annotation tool for Windows, built with AutoHotkey v2 and GDI+.

Draw directly on top of any screen with multiple tools (freehand, line, rectangle, ellipse, circle, arrow), configurable hotkeys, and an INI-based settings system. Run it as source (.ahk) or as a compiled standalone .exe.

Highlights

  • Fast overlay drawing with GDI+ anti-aliased rendering
  • Drawing tools: freehand, straight line, rectangle, ellipse, circle, arrow
  • Dynamic line width and opacity controls
  • Color palette with single-key shortcuts (fully configurable in settings.ini)
  • Built-in hotkeys help dialog (F1 by default, configurable in settings.ini)
  • Undo and Redo support for all drawing actions, including clearing the screen
  • Clear all drawings while in drawing mode with a single key or button
  • Right-click in-place settings panel: color picker, line width, opacity, quick actions
  • Pen cursor while drawing mode is active
  • Always-on-top help and info windows that don't get lost behind the overlay
  • Multi-monitor support — starts on the monitor the mouse cursor is on
  • Per-monitor DPI awareness with multiple fallbacks for mixed-scaling setups
  • Shapes are preserved across drawing sessions (within the same monitor)
  • Remembers your last used drawing settings (color, line width, opacity) across application restarts

Requirements

  • Windows
  • AutoHotkey v2.x (for source usage only)
  • Gdip_all.ahk in the same folder as the main script

If you use the compiled .exe, AutoHotkey installation is not required.

Quick Start

Option 1: Run from source

  1. Install AutoHotkey v2.
  2. Keep these files in the same directory:
    • On Screen Drawing.ahk
    • Gdip_all.ahk
    • settings.ini (optional — defaults are applied automatically)
    • app_icon.ico (optional — used for the tray icon)
  3. Run On Screen Drawing.ahk.
  4. Press Ctrl+F9 (default) to start drawing mode.

Option 2: Run compiled EXE

  1. Download the latest release .exe from the Releases page.
  2. Optionally place settings.ini next to the .exe for custom settings.
  3. Run the executable.

Default Controls

Global hotkeys (always active)

Hotkey Action
Ctrl+F9 Toggle drawing mode on/off
F1 Show hotkeys help
Ctrl+Shift+F12 Exit the application

While in drawing mode

Hotkey / Action Description
Esc Clear all drawings
Backspace Undo last drawing action (can restore a cleared screen)
Shift+Backspace Redo last undone action
XButton1 (Mouse Back) Undo last drawing action (can restore a cleared screen)
XButton2 (Mouse Forward) Redo last undone action
Ctrl+NumpadAdd Increase line width
Ctrl+NumpadSub Decrease line width
WheelUp / WheelDown Increase / decrease line width
Right-click on overlay Open in-place settings panel

Tool selection (hold modifier before clicking to draw)

Modifier Tool
(none) Freehand
Shift Straight line
Ctrl Rectangle
Alt Ellipse
Ctrl+Alt Circle (radius = max of X/Y drag distance)
Ctrl+Shift Arrow (with auto-sized filled arrowhead)

Color hotkeys (default, configurable in settings.ini)

Key Color Key Color Key Color
r Red m Magenta s Brown
g Green c Cyan w White
b Blue o Orange n Gray
y Yellow v Violet k Black

Color hotkeys are only active while drawing mode is on and the mouse cursor is on the active monitor.

Right-Click Settings Panel

Right-clicking anywhere on the overlay opens a compact floating panel that includes:

  • Color grid — shows configured colors in a 3-column grid. The active color is marked with a ✓ checkmark, and hotkey hints are displayed on each swatch by default.
  • Line width — numeric edit field with up/down spinner (1–10 by default).
  • Opacity — numeric edit field with up/down spinner (0–255).
  • Quick action buttons:
    • Undo / Redo
    • Clear — removes all drawings
    • Help — shows the hotkeys help dialog
    • Stop drawing — exit drawing mode
    • Exit application

The panel snaps to within the active monitor's bounds. Press Esc or click away to close it.

Tray Menu

Right-clicking the tray icon shows:

  • About — shows app and author information
  • Hotkeys Help — displays all active hotkeys
  • GitHub repo — opens the project repository
  • Open settings.ini — opens the config file in Notepad
  • Reset to Defaults — restores original settings
  • Reload Script — reloads the application
  • Start/Stop Drawing — toggles drawing mode
  • Exit — closes the app

settings.ini Reference

The app reads settings.ini from the script/exe directory on startup. Missing keys fall back to defaults. You can reset the file to defaults at any time via the tray menu.

[Settings] keys

Key Description Default
StartupLineWidth Initial stroke width 2
MinLineWidth Minimum allowed width 1
MaxLineWidth Maximum allowed width 10
DrawAlpha Drawing opacity (0–255; 255 = fully opaque) 200
FrameIntervalMs Overlay redraw interval (milliseconds) 16
MinPointStep Min distance for freehand points 3
ClearOnExit Discard shapes when closing overlay false
ShowColorHints Show hotkey hints on color swatches true
SaveLastUsedOnExit Remember color, width, opacity on exit true
MaxHistorySize Maximum undo steps to retain 200

[Hotkeys] keys

Key Description Default
ToggleDrawingMode Start/Stop drawing ^F9
ExitApp Close application ^+F12
ClearDrawing Clear all shapes Esc
UndoDrawing Remove last shape Backspace
RedoDrawing Restore last removed shape +Backspace
IncreaseLineWidth Line width + ^NumpadAdd
DecreaseLineWidth Line width - ^NumpadSub
HotkeysHelp Show help window F1

Project Structure

  • On Screen Drawing.ahk (Main script)
  • Gdip_all.ahk (Required library)
  • settings.ini (Config file)
  • app_icon.ico (Icon)

Version History

v1.4 12/03/2026

  • Persistent Settings: The application now automatically saves your last used color, line width, and opacity when exiting, and restores them on the next launch. Two new INI settings (SaveLastUsedOnExit, MaxHistorySize) have been added.
  • Performance Optimization: Major improvements to the freehand drawing tool to avoid memory bottlenecks and provide significantly smoother drawing.
  • Code Organization: Restructured configuration classes and grouped global variables to improve reliability and adhere strictly to DRY principles.

v1.3 08/03/2026

  • UI Enhancement: Added hotkey hints to the color swatches in the right-click settings panel to improve discoverability.
  • New Setting: Introduced the ShowColorHints option in settings.ini to allow users to disable the new color hotkey hints if desired. This is enabled by default.

v1.2.2 07/03/2026

  • Enhanced Undo/Redo: Added support for undoing "Clear Drawing" actions, allowing users to restore all shapes after a total clear.
  • Interaction Fixes: Resolved an issue where the mouse wheel interfered with numeric editboxes in the settings panel; wheel scrolling now correctly adjusts the focused control's value.
  • Code Refactoring & Optimization: Major internal architecture update, centralizing application state and logic (using a unified App object and DrawingColors class) for improved reliability and performance.

v1.2.0 06/03/2026

  • Re-do Support: Restored shapes are preserved in a stack; added RedoLastShape functionality.
  • Mouse Shortcuts: Fast undo/redo using mouse side buttons (XButton1 and XButton2).
  • Improved Settings GUI:
    • Added Clear Drawing and Help buttons to the panel.
    • Reordered action buttons for better workflow (Help, Exit Drawing, Exit App).
  • UI Fixes:
    • Help (F1) and About windows now stay on top and handle focus correctly during drawing (Modal-like overlay behavior).

v1.1.0 05/03/2026

  • Added a configurable HotkeysHelp action with F1 as the default shortcut.
  • Added About and GitHub repo items to the tray menu.
  • Updated tray menu labels to show the assigned hotkeys for drawing toggle, help, and exit actions.
  • Added a pen cursor while drawing mode is active.
  • Improved the floating settings panel so it hides and reopens cleanly instead of being recreated each time.
  • Improved settings panel state syncing for the selected color, line width, and opacity controls.

v1.0.0 05/03/2026

  • Initial public release.
  • Included overlay drawing tools for freehand, line, rectangle, ellipse, circle, and arrow.
  • Included configurable hotkeys, color shortcuts, tray menu actions, and settings.ini support.

Troubleshooting

Nothing happens when pressing the toggle hotkey

  • Check ToggleDrawingMode in settings.ini.
  • Ensure no other application is capturing the same hotkey combination.

Error about GDI+ or screen capture on startup

  • Verify that Gdip_all.ahk exists in the same folder as the script and is compatible with AHK v2.

Wrong position or scale on multi-monitor / mixed-DPI setups

  • The script applies per-monitor DPI awareness with multiple fallbacks. Restart the app after changing monitor layout or DPI settings.

Color hotkeys do not work while drawing

  • Confirm all [Colors] entries follow the 0xRRGGBB format.
  • Make sure the mouse cursor is on the active drawing monitor — color hotkeys are restricted to that monitor.

Shapes disappear when re-entering drawing mode

  • Check that ClearOnExit is set to false in settings.ini.
  • Note: switching to a different monitor always resets the shape list.

Contributing

Issues and pull requests are welcome on GitHub.

When reporting a bug, please include:

  • Windows version
  • AutoHotkey version (if running from source)
  • Your settings.ini contents
  • Steps to reproduce the issue

Credits

Author

Mesut Akcan

About

A lightweight on-screen drawing tool for annotating the screen with lines, rectangles, ellipses, circles, and freehand drawings.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • AutoHotkey 100.0%