可设置dpi

This commit is contained in:
13038267101 2023-01-10 14:25:38 +08:00
parent da908bbf0b
commit 035d90e714
1 changed files with 27 additions and 2 deletions

View File

@ -966,10 +966,35 @@ public:
}
int test_set_auto_distortion(void* data)
{
if (!data)
{
return SCANNER_ERR_DATA_DAMAGED;
}
wchar_t* p = (wchar_t*)data;
std::string str;
int ret = SCANNER_ERR_OK,
val = 0;
dpi = 0;
unsigned int len = sizeof(int);
float distortion =0.0;
float distortion = 0.0;
size_t strl = 0;
ret = wchar_to_char(str, p, &strl);
if (ret == ERROR_INSUFFICIENT_BUFFER)
{
str.resize(strl);
ret = wchar_to_char(str, p, &strl);
if (str.empty())
{
return SCANNER_ERR_DATA_DAMAGED;
}
dpi = atoi(str.c_str());
}
if (dpi > 0)
{
ret = helper_->io_control(IO_CTRL_CODE_SET_DPI, &dpi, &len);
}
parameter* prt = helper_->get_user_input(ui_helper::DATA_FROM_USER, ui_helper::VAL_TYPE_FLOAT, set_test_name_.c_str(), L"请设置畸变值");
if (!prt)
{