https://github.com/miyako/4d-plugin-screen-capture
Screen capture the desktop or a specified window
https://github.com/miyako/4d-plugin-screen-capture
4d-plugin
Last synced: about 1 year ago
JSON representation
Screen capture the desktop or a specified window
- Host: GitHub
- URL: https://github.com/miyako/4d-plugin-screen-capture
- Owner: miyako
- License: mit
- Created: 2013-12-14T06:08:33.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-04-30T09:59:36.000Z (about 2 years ago)
- Last Synced: 2025-04-04T14:11:21.367Z (about 1 year ago)
- Topics: 4d-plugin
- Language: C
- Homepage:
- Size: 6.29 MB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


[](LICENSE)

4d-plugin-screen-capture
========================
Screen capture the desktop or a specified window.
#### Windows
The web area is using hardware acceleration, a performance multiplier for rendering. It is not possible to sample pixels using the classic `BitBlt` API. `BitBlt` will return a black region where the GPU projects its output. It is necessary to capture the GPU representation of the window and locally convert it to bitmap.
On Windows, it is not possible to capture a child window of the MDI using this command.
You can only specify a window reference in **SDI mode**.
#### Note to self
On Windows, you must install **Graphic Tools** in
* Apps > Optional features > Add an optional feature
in order to call [D3D11CreateDevice](https://learn.microsoft.com/en-us/windows/win32/api/d3d11/nf-d3d11-d3d11createdevice) with the `D3D11_CREATE_DEVICE_DEBUG` flag. This is not mandatory for using the plugin.
#### Mac
[CGWindowListCreateImage](https://developer.apple.com/documentation/coregraphics/1454852-cgwindowlistcreateimage?preferredLanguage=occ) is used with `CGRectNull` to capture a window.
The shadow is ignored (`kCGWindowImageBoundsIgnoreFraming`).
For the screen, the `kCGNullWindowID` and `kCGWindowListOptionOnScreenOnly` is used.
### Syntax
[miyako.github.io](https://miyako.github.io/2023/03/08/4d-plugin-screen-capture.html)