From 6e5d7a683a19b0257be84353b6b860e2c72892e7 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Sat, 26 Aug 2023 09:16:00 +0800 Subject: [PATCH] =?UTF-8?q?no=5Fbitdepth=5F=E5=B7=B2=E7=BB=8F=E5=A4=84?= =?UTF-8?q?=E7=90=86=E4=BA=86=E5=86=9B=E9=98=9F=E6=89=AB=E6=8F=8F2.0.exe?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9B=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=95=B4=E6=95=B0=E7=A9=BA=E5=80=BC=E7=9A=84?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twain/twain/huagaods.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/twain/twain/huagaods.cpp b/twain/twain/huagaods.cpp index 6aae187..5aa7318 100644 --- a/twain/twain/huagaods.cpp +++ b/twain/twain/huagaods.cpp @@ -1988,12 +1988,6 @@ void huagao_ds::init_support_caps(void) auto mech = data.currentItem(); if (Msg::Set == msg) { -#ifdef ARMY_SCANNER - if (mech >= 0 && mech <= 2) - val = mech; - else - val = COLOR_RGB; -#else if (mech == 1) val = COLOR_BW; else if (mech == 8) @@ -2002,7 +1996,6 @@ void huagao_ds::init_support_caps(void) val = COLOR_RGB; else val = COLOR_RGB; // mech; -#endif } { wchar_t info[128] = { 0 }; @@ -3711,7 +3704,19 @@ DWORD huagao_ds::get_config_number(const wchar_t* sec, const wchar_t* key, DWORD if (cfg_f.empty()) return empty; else - return GetPrivateProfileIntW(sec, key, def, get_config_file().c_str()); + { + DWORD val = GetPrivateProfileIntW(sec, key, def, cfg_f.c_str()); + if (val == def) + { + val = GetPrivateProfileIntW(sec, key, def + 2, cfg_f.c_str()); + if (val == def + 2) + val = empty; + else + val = def; + } + + return val; + } } int huagao_ds::handle_scanner_event(int ev, bool from_event_proc) {