Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added API method in window - captureWindow #137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

WannaCry016
Copy link

Description

This pull request introduces functionality for the neutralino.window.captureScreen(filepath) method, which captures the current application window and saves it as a screenshot to the specified file path. This functionality is fully implemented for Windows and Linux, with error handling and fallback mechanisms.

Changes proposed

  • Implemented screen capture functionality for Windows using GDI+ with fallback to BitBlt.
  • Enhanced Linux support with GTK for screen capturing.
  • Added error handling and informative log messages for troubleshooting.
  • Added test suite for captureScreen method.

How to test it

  • Run the application and call the neutralino.window.captureScreen("screenshot.png") function.
  • Verify the output:
    • Ensure a screenshot.png file is saved in the specified directory.
    • Check the content of the screenshot to ensure it reflects the application window.
  • Test on both Windows and Linux platforms:
    • Windows: Ensure that PrintWindow or BitBlt is used for capturing the screen.
    • Linux: Verify the GTK functionality for capturing the screen.

Screenshot 2024-11-30 235104

Next steps

Extend the captureScreen functionality to support macOS.

Deploy notes

The changes are backward-compatible and do not impact other features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant