可设置dpi
This commit is contained in:
parent
da908bbf0b
commit
035d90e714
|
@ -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;
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue