添加获取纸张尺寸接口

This commit is contained in:
gb 2022-06-24 17:06:43 +08:00
parent 34e0dbfb95
commit ded9d29b5f
1 changed files with 8 additions and 0 deletions

View File

@ -2563,6 +2563,14 @@ int hg_scanner::device_io_control(unsigned long code, void* data, unsigned* len)
return wait_img_.is_waiting() && wait_usb_.is_waiting() ? SCANNER_ERR_NO_DATA : SCANNER_ERR_OK;
}
else if (code == IO_CTRL_CODE_GET_PAPER_SIZE)
{
std::string name((char*)data);
int paper = match_best_paper(name, NULL);
SIZE size = paper_size(paper);
*len = (size.cx & 0x0ffff) | ((size.cy & 0x0ffff) << 16);
}
return SCANNER_ERR_DEVICE_NOT_SUPPORT;
}