From 7d28c0d9766efd514b8860661be39185a7707c46 Mon Sep 17 00:00:00 2001 From: nashaofu Date: Wed, 1 Jan 2025 12:17:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/windows/capture.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/windows/capture.rs b/src/windows/capture.rs index 9740556..7d715cd 100644 --- a/src/windows/capture.rs +++ b/src/windows/capture.rs @@ -46,7 +46,7 @@ fn to_rgba_image( unsafe { // 读取数据到 buffer 中 - let is_success = GetDIBits( + let is_failed = GetDIBits( *box_hdc_mem, *box_h_bitmap, 0, @@ -56,7 +56,7 @@ fn to_rgba_image( DIB_RGB_COLORS, ) == 0; - if is_success { + if is_failed { return Err(XCapError::new("Get RGBA data failed")); } }; @@ -152,7 +152,7 @@ pub fn capture_window( } if !is_success { - is_success = PrintWindow(hwnd, *box_hdc_mem, PRINT_WINDOW_FLAGS(3)).as_bool(); + is_success = PrintWindow(hwnd, *box_hdc_mem, PRINT_WINDOW_FLAGS(4)).as_bool(); } if !is_success {