{"id":19375750,"url":"https://github.com/mika-f/dotnet-window-capture","last_synced_at":"2025-04-23T18:32:49.031Z","repository":{"id":41370304,"uuid":"185414267","full_name":"mika-f/dotnet-window-capture","owner":"mika-f","description":"Captures a window or desktop screen and renders it in WPF or DirectX.","archived":false,"fork":false,"pushed_at":"2022-11-21T09:40:02.000Z","size":41,"stargazers_count":147,"open_issues_count":4,"forks_count":37,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-02T18:11:31.090Z","etag":null,"topics":["capture","capture-screen","csharp","win32","windows"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mika-f.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-07T14:04:17.000Z","updated_at":"2025-03-29T13:46:04.000Z","dependencies_parsed_at":"2022-07-30T07:07:54.757Z","dependency_job_id":null,"html_url":"https://github.com/mika-f/dotnet-window-capture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mika-f%2Fdotnet-window-capture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mika-f%2Fdotnet-window-capture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mika-f%2Fdotnet-window-capture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mika-f%2Fdotnet-window-capture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mika-f","download_url":"https://codeload.github.com/mika-f/dotnet-window-capture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250490519,"owners_count":21439157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capture","capture-screen","csharp","win32","windows"],"created_at":"2024-11-10T08:40:00.688Z","updated_at":"2025-04-23T18:32:48.723Z","avatar_url":"https://github.com/mika-f.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# .NET Window Capture Samples\n\n\u003e NOTE: This is an experimental project. Please use it at your own risk.\n\nCaptures a window or desktop screen and renders it in WPF or DirectX.\n\n## System Requirements\n\n- Windows 10 (64-bit, April 2018 Update)\n- DirectX 11\n- .NET Framework 4.7.2\n- Visual Studio 2019\n\n## Capture Methods\n\n| Project Name               | Minimal Windows Version | Render To | Platform |\n| -------------------------- | ----------------------- | --------- | -------- |\n| `Win32.BitBlt`             | Windows 95              | DirectX   | Win32    |\n| `Win32.DesktopDuplication` | Windows 8               | DirectX   | Win32    |\n| `Win32.DwmSharedSurface`   | Windows 7               | DirectX   | Win32    |\n| `Win32.DwmThumbnail`       | Windows 7               | WPF       | Win32    |\n| `WinRT.GraphicsCapture`    | Windows 10 1803         | DirectX   | WinRT    |\n\n## Comparison\n\n### Compare with capture target\n\n| Capture Method             | Window Capture | Desktop Capture | Outside of Desktop | HW Acceleration | DirectX Games |\n| -------------------------- | :------------: | :-------------: | :----------------: | :-------------: | :-----------: |\n| `Win32.BitBlt`             |      Yes       |       Yes       |        Yes         |       No        |      Yes      |\n| `Win32.DesktopDuplication` |       No       |       Yes       |         No         |       Yes       |      Yes      |\n| `Win32.DwmSharedSurface`   |      Yes       |       No        |        Yes         |       No        |      Yes      |\n| `Win32.DwmThumbnail`       |      Yes       |       No        |        Yes         |       Yes       |      Yes      |\n| `WinRT.GraphicsCapture`    |      Yes       |       Yes       |        Yes         |       Yes       |      Yes      |\n\n- `Games` is checked using [Märchen Forest](https://anemonecoronaria.sakura.ne.jp/merufore/).\n\n### Compare with capture source\n\n| Capture Method             | Window Handle | Monitor Handle |     Another      |\n| -------------------------- | :-----------: | :------------: | :--------------: |\n| `Win32.BitBlt`             |      Yes      |       No       |        -         |\n| `Win32.DesktopDuplication` |      No       |       No       | Device (Monitor) |\n| `Win32.DwmSharedSurface`   |      Yes      |       No       |        -         |\n| `Win32.DwmThumbnail`       |      Yes      |       No       |        -         |\n| `WinRT.GraphicsCapture`    |    Yes \\*     |     Yes \\*     | Embedded Picker  |\n\n- \\*: Require Windows 10 1903 or greater.\n\n### Compare with delay\n\n| Capture Method             | Delay (ms) |\n| -------------------------- | :--------: |\n| `Win32.BitBlt`             |   ~ 20ms   |\n| `Win32.DesktopDuplication` |    N/A     |\n| `Win32.DwmSharedSurface`   |   ~ 20ms   |\n| `Win32.DwmThumbnail`       |  **0ms**   |\n| `WinRT.GraphicsCapture`    |   ~ 40ms   |\n\n- I used [this video](https://www.youtube.com/watch?v=rf2Lmfqi5ZM) to investigate the delay.\n- It is just a reference value, but it is certain that the delay of `Win32.DwmThumbnail` is 0 ms.\n  - This is because it uses a drawing method that is entirely common to other windows.\n\n## License\n\nThis project is licensed under the MIT license.\n\n## Third-Party Notices\n\n### Dependencies\n\n- [Microsoft.Windows.SDK.Contracts](https://www.nuget.org/packages/Microsoft.Windows.SDK.Contracts/)\n- [SharpDX](https://www.nuget.org/packages/SharpDX/)\n\n### Code Includes\n\n- [SharpDX Samples](https://github.com/sharpdx/SharpDX-Samples) (MIT)\n- [Windows Universal Samples](https://github.com/microsoft/Windows-universal-samples) (MIT)\n- [Windows.UI.Composition Win32 Samples](https://github.com/microsoft/Windows.UI.Composition-Win32-Samples) (MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmika-f%2Fdotnet-window-capture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmika-f%2Fdotnet-window-capture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmika-f%2Fdotnet-window-capture/lists"}