screenshot_desktop 1.1.0 copy "screenshot_desktop: ^1.1.0" to clipboard
screenshot_desktop: ^1.1.0 copied to clipboard

A pure Dart package for capturing high-resolution desktop screenshots and individual windows on macOS and Windows, with multi-monitor support.

example/screenshot_desktop_example.dart

import 'package:screenshot_desktop/screenshot_desktop.dart';
import 'dart:io';

void main() async {
  if (!ScreenshotDesktop.instance.hasPermission()) {
    await ScreenshotDesktop.instance.requestPermission();
  }
  final availableMonitors = await ScreenshotDesktop.instance
      .getAvailableMonitors();

  print('Available Monitors:');
  for (final monitor in availableMonitors) {
    print(' - ${monitor.name} (${monitor.width}x${monitor.height})');
  }

  if (availableMonitors.isNotEmpty) {
    print(
      'Taking screenshot of the first monitor: ${availableMonitors.first.name}',
    );
    final screenshot = await ScreenshotDesktop.instance.takeScreenshot(
      availableMonitors.first,
    );
    await File('screenshot.bmp').writeAsBytes(screenshot);
    print('Screenshot saved to screenshot.bmp');
  }
}
2
likes
130
points
155
downloads

Publisher

unverified uploader

Weekly Downloads

A pure Dart package for capturing high-resolution desktop screenshots and individual windows on macOS and Windows, with multi-monitor support.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

code_assets, ffi, hooks, native_toolchain_c, objective_c, win32

More

Packages that depend on screenshot_desktop