mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 05:32:47 +00:00
GUIでcrop_sizeを指定出来るようにした
This commit is contained in:
parent
07a2a0fe46
commit
57fbdf4225
Binary file not shown.
@ -152,7 +152,7 @@ private:
|
||||
scale_ratio = 2.0;
|
||||
ret = false;
|
||||
|
||||
MessageBox(dh, TEXT("拡大率は数字である必要があります"), TEXT("エラー"), MB_OK | MB_ICONERROR);
|
||||
MessageBox(dh, TEXT("拡大率は0.0より大きい正数である必要があります"), TEXT("エラー"), MB_OK | MB_ICONERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,6 +179,22 @@ private:
|
||||
inputFileExt = buf;
|
||||
}
|
||||
|
||||
{
|
||||
char buf[AR_PATH_MAX] = "";
|
||||
GetWindowTextA(GetDlgItem(dh, IDC_EDIT_CROP_SIZE), buf, _countof(buf));
|
||||
buf[_countof(buf) - 1] = '\0';
|
||||
|
||||
char *ptr = nullptr;
|
||||
crop_size = strtol (buf, &ptr, 10);
|
||||
if (!ptr || *ptr != '\0')
|
||||
{
|
||||
crop_size = 128;
|
||||
ret = false;
|
||||
|
||||
MessageBox(dh, TEXT("分割サイズは0より大きい整数である必要があります"), TEXT("エラー"), MB_OK | MB_ICONERROR);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -559,6 +575,7 @@ public:
|
||||
SetWindowTextA(GetDlgItem(hWnd, IDC_EDIT_SCALE_RATIO), text);
|
||||
SetWindowTextA(GetDlgItem(hWnd, IDC_EDIT_OUT_EXT), outputExt.c_str());
|
||||
SetWindowTextA(GetDlgItem(hWnd, IDC_EDIT_INPUT_EXT_LIST), inputFileExt.c_str());
|
||||
SetWindowTextA(GetDlgItem(hWnd, IDC_EDIT_CROP_SIZE), std::to_string(crop_size).c_str());
|
||||
}
|
||||
|
||||
void Cancel(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData)
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user