mirror of
https://github.com/SillyTavern/Extension-ScreenShare.git
synced 2026-10-15 13:32:02 +00:00
[GH-ISSUE #2] FEATURE REQUEST: Support for capturing only a specific, defined area of the screen instead of the whole screen. #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @PalaVR-AI on GitHub (Oct 15, 2024).
Original GitHub issue: https://github.com/SillyTavern/Extension-ScreenShare/issues/2
Feature Request - the ability to define a fixed portion of the window to capture instead of the entire screen.
Use case: Using SIllyTavern in a browser to the laft of a 2560x1440 game played centered on an ultrawide monitor
Currently: Screenshare sends the full 5120x1440 image, and the LLM comments on the whole thing.
Desired: Being able to define a screencapture window that is (in this use case) something like
context.drawImage(bitmap, 1280, 40, 2152, 1348)
which would capture (if I have the order of the values correctly) a "viewport" that is 2152 wide by 1348 tall (the game viewport minus the title bar at the top and the taskbar at the bottom) that is 1280 pixels from the left, and 40 pixels down (e.g. a centered, windowed game without capturing anything that's not actually the game...)
Where?
Line 34 where the canvas is defined as the whole screen...
and
Line 134 where it looks like an offset is hardcoded as "upper left"
canvas.width = bitmap.width;
canvas.height = bitmap.height;
const context = canvas.getContext('2d');
context.drawImage(bitmap, 0, 0, canvas.width, canvas.height);