Skip to content

Commit

Permalink
feat: 优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
nashaofu committed Jan 4, 2025
1 parent 34fbdda commit 7d28c0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/windows/capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"));
}
};
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 7d28c0d

Please sign in to comment.