From c699b06ff750003b81315009e80617041748d799 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 02 八月 2022 18:06:16 +0800 Subject: [PATCH] '完善' --- ConsoleApplication/win32_screen_shots.cpp | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ConsoleApplication/win32_screen_shots.cpp b/ConsoleApplication/win32_screen_shots.cpp index 4601206..ad976eb 100644 --- a/ConsoleApplication/win32_screen_shots.cpp +++ b/ConsoleApplication/win32_screen_shots.cpp @@ -22,14 +22,8 @@ if (GetWindowRect(h, &rect) == FALSE) break; - if (rect.left < 0) - rect.left = 0; - - if (rect.top < 0) - rect.top = 0; - - width = rect.right - rect.left; - height = rect.bottom - rect.top; + width = abs( rect.right - rect.left); + height =abs( rect.bottom - rect.top); hdc = GetWindowDC(h); if (hdc == nullptr) -- Gitblit v1.8.0