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

Fix screenshots with scaling or size argument #3138

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

bruyeret
Copy link
Contributor

@bruyeret bruyeret commented Oct 4, 2024

The screenshot feature did not work with several renderwindows linked to a root render window.

To reproduce the issue, you can edit the ManyRenderWindows example.
Change the action of the Remove render window button to make screenshots.
To do so, at the line button.addEventListener, replace the listener using this code:

  button.addEventListener('click', () => {
    renderWindowView.captureNextImage(null, { scale: 5 }).then((result) => {
      const newWindow = window.open('');
      newWindow.document.write(`<img src="${result}" alt="Image Preview" />`);
    });
    renderWindow.render();
  });

@bruyeret bruyeret requested a review from finetjul October 4, 2024 11:53
Copy link
Member

@finetjul finetjul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@sankhesh sankhesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@finetjul finetjul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@finetjul finetjul added this pull request to the merge queue Oct 4, 2024
Merged via the queue into Kitware:master with commit 9ab7ac8 Oct 4, 2024
3 checks passed
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.

3 participants