diff --git a/waifu2x-caffe-gui/MainDialog.cpp b/waifu2x-caffe-gui/MainDialog.cpp index 6ba3b68..509fd21 100644 --- a/waifu2x-caffe-gui/MainDialog.cpp +++ b/waifu2x-caffe-gui/MainDialog.cpp @@ -995,6 +995,7 @@ void DialogEvent::SaveIni(const bool isSyncMember) tstring tScaleRatio; tstring tScaleWidth; tstring tScaleHeight; + tstring tScaleWidthHeight; tstring tmode; tstring tScaleMode; tstring tprcess; @@ -1014,6 +1015,11 @@ void DialogEvent::SaveIni(const bool isSyncMember) else tScaleHeight = TEXT(""); + if (scale_width > 0 && scale_height > 0) + tScaleWidthHeight = to_tstring(scale_width) + TEXT("x") + to_tstring(scale_height); + else + tScaleWidthHeight = TEXT(""); + switch (mode) { case Waifu2x::eWaifu2xModelTypeNoise: @@ -1055,6 +1061,8 @@ void DialogEvent::SaveIni(const bool isSyncMember) WritePrivateProfileString(TEXT("Setting"), TEXT("LastScaleHeight"), tScaleHeight.c_str(), getTString(SettingFilePath).c_str()); + WritePrivateProfileString(TEXT("Setting"), TEXT("LastScaleWidthHeight"), tScaleWidthHeight.c_str(), getTString(SettingFilePath).c_str()); + WritePrivateProfileString(TEXT("Setting"), TEXT("LastOutputExt"), outputExt.c_str(), getTString(SettingFilePath).c_str()); WritePrivateProfileString(TEXT("Setting"), TEXT("LastInputFileExt"), inputFileExt.c_str(), getTString(SettingFilePath).c_str()); @@ -1813,6 +1821,10 @@ void DialogEvent::Create(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData) tmp[_countof(tmp) - 1] = TEXT('\0'); tScaleHeight = tmp; + GetPrivateProfileString(TEXT("Setting"), TEXT("LastScaleWidthHeight"), TEXT("0"), tmp, _countof(tmp), getTString(SettingFilePath).c_str()); + tmp[_countof(tmp) - 1] = TEXT('\0'); + tScaleWidthHeight = tmp; + GetPrivateProfileString(TEXT("Setting"), TEXT("LastScaleMode"), TEXT("Ratio"), tmp, _countof(tmp), getTString(SettingFilePath).c_str()); tmp[_countof(tmp) - 1] = TEXT('\0'); tScaleMode = tmp;