{"id":33930937,"url":"https://github.com/h04x/win-screenshot","last_synced_at":"2026-04-09T00:02:06.805Z","repository":{"id":49951021,"uuid":"491618859","full_name":"h04x/win-screenshot","owner":"h04x","description":"Take a screenshot of a specific window or entire screen on Windows platform","archived":false,"fork":false,"pushed_at":"2025-11-22T08:04:34.000Z","size":73,"stargazers_count":43,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-13T22:30:01.338Z","etag":null,"topics":["capture","display","screen","screenshot","window","windows"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/win-screenshot","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/h04x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-05-12T18:04:03.000Z","updated_at":"2025-11-22T08:04:38.000Z","dependencies_parsed_at":"2025-11-22T10:11:19.244Z","dependency_job_id":null,"html_url":"https://github.com/h04x/win-screenshot","commit_stats":{"total_commits":67,"total_committers":1,"mean_commits":67.0,"dds":0.0,"last_synced_commit":"26cdbaa97b13e089904fd16dedc5e4d488c0a71c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/h04x/win-screenshot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h04x%2Fwin-screenshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h04x%2Fwin-screenshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h04x%2Fwin-screenshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h04x%2Fwin-screenshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h04x","download_url":"https://codeload.github.com/h04x/win-screenshot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h04x%2Fwin-screenshot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31579058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","display","screen","screenshot","window","windows"],"created_at":"2025-12-12T12:21:05.999Z","updated_at":"2026-04-09T00:02:06.774Z","avatar_url":"https://github.com/h04x.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# win-screenshot\nTake a screenshot of a specific window or entire screen on Windows platform\n\n## Known Issues\n`capture_window()` draws black border for some windows  \nIf you call `capture_window()` and got `0x80070578 \"invalid window handle\"` make sure captured window is not minimized\n\n## Minimum requirements\n`capture_window()` uses undocumented `PW_RENDERFULLCONTENT` which first appeared in Windows 8.1\n\n## Examples\n```rust\nuse image::{DynamicImage, RgbaImage};\nuse regex::Regex;\nuse win_screenshot::prelude::*;\n\nfn main() {\n    // Capture entire screen\n    let buf = capture_display().unwrap();\n\n    // Capture window by known id\n    let buf = capture_window(11996706).unwrap();\n\n    // Capture window if you know the exact name\n    let hwnd = find_window(\"Notepad\").unwrap();\n    let buf = capture_window(hwnd).unwrap();\n\n    // If you don't know the exact name, try to find it\n    let re = Regex::new(r\"Steam\").unwrap();\n    let hwnd = window_list()\n        .unwrap()\n        .iter()\n        .find(|i| re.is_match(\u0026i.window_name))\n        .unwrap()\n        .hwnd;\n    let buf = capture_window(hwnd).unwrap();\n\n    // convert to image and save\n    let img = DynamicImage::ImageRgba8(\n        RgbaImage::from_raw(buf.width, buf.height, buf.pixels).unwrap());\n    img.to_rgb8().save(\"screenshot.jpg\").unwrap();\n\n    // Fine tuning\n\n    // BitBlt dramatically faster, often fails\n    // (e.g. firefox, steam, 3d accelerated windows)\n    let using = Using::BitBlt;\n    // PrintWindow much slower, much more reliable\n    let using = Using::PrintWindow;\n\n    // Capture client area of window\n    let area = Area::ClientOnly;\n    // Capture whole window (not supported with BitBlt)\n    let area = Area::Full;\n\n    // Build-in crop, faster on large windows\n    let crop_xy = None; //Some([100, 100]);\n    let crop_wh = None; //Some([300, 300]);\n    let buf = capture_window_ex(hwnd, using, area, crop_xy, crop_wh).unwrap();\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh04x%2Fwin-screenshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh04x%2Fwin-screenshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh04x%2Fwin-screenshot/lists"}