Skip to content

A cross-platform screen capture and annotation tool built with Rust and Druid. Fulfills all core and bonus requirements for our university project.

License

Notifications You must be signed in to change notification settings

frontinus/rust_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📸 Screen Grabber - Advanced Multi-Platform Screenshot Utility

Rust Windows macOS Linux

A powerful, feature-rich screenshot application built with Rust and Druid

FeaturesInstallationUsageKeyboard ShortcutsDocumentation


🎯 Overview

Screen Grabber is a modern, cross-platform screenshot utility that goes beyond simple screen capturing. With advanced annotation tools, real-time editing, and multi-monitor support, it's designed for professionals who need precision and flexibility in their workflow.

✨ Why Screen Grabber?

  • 🎨 Rich Annotation Tools: Add circles, arrows, text, and highlights directly to your screenshots
  • 🖥️ Multi-Monitor Ready: Seamlessly capture from any connected display
  • ⚡ Lightning Fast: Built in Rust for maximum performance
  • 🎨 Post-Capture Editing: Crop and annotate after taking the screenshot
  • ⌨️ Customizable Shortcuts: Define your own hotkey combinations
  • 📋 Clipboard Integration: Instant copy-to-clipboard with Ctrl+C
  • 🎯 Pixel-Perfect Selection: Precise region selection with visual guides

🚀 Features

Core Functionality

📷 Flexible Capture Modes

  • Full Screen: Capture entire monitor with one click
  • Custom Region: Click-and-drag to select any area
  • Delay Timer: 0-10 second countdown for timed captures
  • Multi-Monitor: Choose which screen to capture from dropdown

🎨 Annotation Suite

  • Shapes: Circles, triangles, arrows, and rectangles
  • Highlighter: Semi-transparent overlay for emphasis
  • Text Tool: Add custom text with font support
  • Color Picker: 17 preset colors with adjustable transparency
  • Alpha Slider: Control annotation opacity (1-100%)

✂️ Post-Processing

  • Intelligent Crop: Refine captured area after screenshot
  • Real-time Preview: See changes before saving
  • Resizable Annotations: Drag and resize overlays
  • Layer Management: Non-destructive editing workflow

💾 Export Options

  • Multiple Formats: PNG, JPG, GIF
  • Smart Naming: Auto-generate unique filenames or use custom names
  • Custom Save Paths: Choose where to save your screenshots
  • Clipboard Support: Copy directly to clipboard for quick sharing

⚙️ Advanced Settings

  • Customizable Hotkeys: Set your preferred keyboard shortcuts
  • Persistent Configuration: Settings saved between sessions
  • Multi-Monitor Selection: Easy screen switcher in UI
  • DPI Aware: Handles high-DPI displays correctly (125%, 150%, 200%)

📋 Requirements

System Requirements

  • OS: Windows 10/11, macOS 10.14+, or Linux (Ubuntu 18.04+, Fedora 30+)
  • RAM: 256 MB minimum
  • Disk Space: ~50 MB

Development Requirements

  • Rust: 1.70.0 or higher
  • Cargo: Latest stable version

Platform-Specific Dependencies

Linux

# Ubuntu/Debian
sudo apt-get install libgtk-3-dev libx11-dev libxcb1-dev

# Fedora
sudo dnf install gtk3-devel libX11-devel libxcb-devel

# Arch
sudo pacman -S gtk3 libx11 libxcb

macOS

# Xcode Command Line Tools required
xcode-select --install

Windows

No additional dependencies required.


🔧 Installation

Option 1: Build from Source (Recommended)

# Clone the repository
git clone https://github.com/frontinus/rust_project.git
cd rust_project/application

# Build in release mode
cargo build --release

# Run the application
cargo run --release

Option 2: Pre-built Binaries

Download the latest release for your platform from the Releases page.


🎮 Usage

Quick Start

  1. Launch the application
   cargo run --release
  1. Take a screenshot

    • Press your configured hotkey (default: KeyB + KeyA)
    • Or click "Take Screenshot" button
    • Select region by clicking and dragging
  2. Annotate (Optional)

    • Click annotation tools (⭕, △, →, etc.)
    • Drag to position, resize as needed
    • Adjust color and transparency
  3. Save

    • Click "Save" or let auto-save handle it
    • Find your screenshot in ./src/screenshots/

Screenshot Workflow

┌─────────────┐
│   Capture   │ ──┐
└─────────────┘   │
                  ▼
┌─────────────────────┐
│  Review & Annotate  │
│  • Add shapes       │
│  • Add text         │
│  • Adjust colors    │
└─────────────────────┘
                  │
                  ▼
┌─────────────────────┐
│   Crop (Optional)   │
└─────────────────────┘
                  │
                  ▼
┌─────────────────────┐
│  Save/Copy/Export   │
└─────────────────────┘

⌨️ Keyboard Shortcuts

Global Shortcuts

Shortcut Action
Custom Hotkey Open screenshot overlay (configurable in settings)
Ctrl + C Copy current screenshot to clipboard
Esc Close screenshot overlay / Cancel current operation
Ctrl + W Close main window

Screenshot Overlay

Shortcut Action
Click + Drag Select capture region
Arrow Keys Fine-tune selection (1px increments)
Shift + Arrow Keys Fine-tune selection (10px increments)
Enter Confirm selection and capture
Esc Cancel and close overlay

Reserved Combinations

The following shortcuts are reserved and cannot be customized:

  • Ctrl + C - System copy function
  • Ctrl + W - Window close
  • Esc - Cancel operations

📖 Documentation

Project Structure

screen-grabber/
├── application/
│   ├── src/
│   │   ├── custom_widget/      # Custom UI components
│   │   │   ├── alert.rs
│   │   │   ├── colored_button.rs
│   │   │   ├── custom_slider.rs
│   │   │   ├── custom_zstack.rs    # Layer management
│   │   │   ├── resizable_box.rs    # Annotation container
│   │   │   ├── screenshot_image.rs # Image handling
│   │   │   ├── selected_rect.rs    # Selection rectangle
│   │   │   ├── shortcut_keys.rs    # Hotkey management
│   │   │   └── take_screenshot_button.rs
│   │   ├── images/
│   │   │   └── icons/          # Annotation overlays
│   │   ├── screenshots/        # Default save location
│   │   ├── shortcut/           # Hotkey settings
│   │   └── main.rs             # Application entry point
│   ├── Cargo.toml
│   └── Cargo.lock
└── README.md

Key Components

Custom Widgets

  • CustomZStack: Manages layered images and annotations
  • ScreenshotImage: Handles image display, cropping, and transformations
  • SelectedRect: Interactive selection rectangle with 8-point resizing
  • ResizableBox: Container for movable/resizable annotation overlays
  • CustomSlider: Transparency control with real-time preview
  • ShortcutKeys: Keyboard shortcut configuration and persistence

Image Processing Pipeline

Screen Capture (screenshots crate)DPI Scaling CorrectionRegion SelectionAnnotation Layer CompositionOptional CroppingFormat Conversion (PNG/JPG/GIF)Save to Disk / Copy to Clipboard

🛠️ Configuration

Settings File

Settings are automatically saved to:

  • Windows: ./src/shortcut/shortcut_settings.json
  • macOS/Linux: ./src/shortcut/shortcut_settings.json

Customizing Hotkeys

  1. Click SettingsShortcut Keys
  2. Click "Change Shortcut"
  3. Press your desired key combination
  4. Settings auto-save on confirmation

Default Save Location

Screenshots are saved to ./src/screenshots/ by default. To change:

  1. Click SettingsSet Path
  2. Select your preferred directory
  3. All future screenshots will save there

🐛 Troubleshooting

Common Issues

❌ "Window too small" / "Cropped screenshot"

Cause: Windows display scaling (125%, 150%, etc.)
Solution: Already handled in v1.0+. If issues persist, check DPI settings.

❌ "Hotkey not working"

Cause: Conflicting system shortcut
Solution: Choose a different key combination in Settings → Shortcut Keys

❌ "Screenshot captures the overlay window"

Cause: Timing issue with window hiding
Solution: Increase delay timer to 1-2 seconds

❌ "Cannot save screenshot"

Cause: Invalid save path or permissions
Solution: Check write permissions in selected directory

Debug Mode

Run with verbose logging:

RUST_LOG=debug cargo run --release

🤝 Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Development Setup

# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Clone and build
git clone https://github.com/frontinus/rust_project.git
cd rust_project/application
cargo build

# Run tests
cargo test

# Run with hot reload (using cargo-watch)
cargo install cargo-watch
cargo watch -x run

Code Style

  • Follow Rust API Guidelines
  • Run cargo fmt before committing
  • Ensure cargo clippy passes without warnings
  • Add tests for new features

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.


👥 Authors

Original Development Team

  • Pietro Bertorelle
  • Francesco Abate
  • Elio Magliari

🙏 Acknowledgments


📊 Project Status

Build Status Version License

Current Version: 1.1.0
Status: Active Development
Last Updated: November 2025


🗺️ Roadmap

Planned Features

  • Video Recording: Capture screen video with audio
  • GIF Animation: Create animated GIFs from screen recordings
  • Cloud Sync: Auto-upload to Google Drive/Dropbox
  • OCR Integration: Extract text from screenshots
  • Drawing Tools: Freehand pen, brush, eraser
  • Blur/Pixelate: Privacy-focused redaction tools
  • Annotations Presets: Save favorite annotation styles
  • Batch Processing: Apply edits to multiple screenshots
  • Screen Recording History: Timeline view of all captures
  • Collaboration: Share screenshots with annotations

Made with ❤️ and Rust

⭐ Star us on GitHub if you find this useful!

Report BugRequest Feature

About

A cross-platform screen capture and annotation tool built with Rust and Druid. Fulfills all core and bonus requirements for our university project.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages