mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 13:42:48 +00:00
GUIで起動時にcrop_size_list.txtから読みだした分割サイズをリストに表示するようにした
This commit is contained in:
parent
74eb842790
commit
927726889a
@ -909,6 +909,31 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
HWND hcrop = GetDlgItem(dh, IDC_COMBO_CROP_SIZE);
|
||||
|
||||
SendMessage(hcrop, CB_ADDSTRING, 0, (LPARAM)TEXT("-----------------------"));
|
||||
|
||||
// CropSizeList‚Ì’l‚ð’ljÁ‚µ‚Ä‚¢‚
|
||||
int mindiff = INT_MAX;
|
||||
int defaultListIndex = -1;
|
||||
for (const auto n : CropSizeList)
|
||||
{
|
||||
tstring str(to_tstring(n));
|
||||
const int index = SendMessage(hcrop, CB_ADDSTRING, 0, (LPARAM)str.c_str());
|
||||
|
||||
const int diff = abs(DefaultCommonDivisor - n);
|
||||
if (DefaultCommonDivisorRange.first <= n && n <= DefaultCommonDivisorRange.second && diff < mindiff)
|
||||
{
|
||||
mindiff = diff;
|
||||
defaultListIndex = index;
|
||||
}
|
||||
}
|
||||
|
||||
if (GetWindowTextLength(hcrop) == 0)
|
||||
SendMessage(hcrop, CB_SETCURSEL, defaultListIndex, 0);
|
||||
}
|
||||
|
||||
const boost::filesystem::path SettingFilePath(exeDir / SettingFileName);
|
||||
|
||||
tstring tScale;
|
||||
|
Loading…
x
Reference in New Issue
Block a user