| 442 | } |
| 443 | |
| 444 | long BindingSession::RectConvert(long &x1, long &y1, long &x2, long &y2) { |
| 445 | |
| 446 | /*if (_capture && (_display == RENDER_TYPE::NORMAL || _display == RENDER_TYPE::GDI)) { |
| 447 | x1 += _capture->_client_x; y1 += _capture->_client_y; |
| 448 | x2 += _capture->_client_x; y2 += _capture->_client_y; |
| 449 | }*/ |
| 450 | |
| 451 | // WGC 在窗口最小化/恢复后尺寸会异步变化,裁剪前先给后端一次刷新机会。 |
| 452 | if (_capture) { |
| 453 | _capture->refreshMetrics(); |
| 454 | } |
| 455 | |
| 456 | x2 = std::min<long>(this->get_width(), x2); |
| 457 | y2 = std::min<long>(this->get_height(), y2); |
| 458 | if (x1 < 0 || y1 < 0 || x1 >= x2 || y1 >= y2) { |
| 459 | setlog(L"invalid rectangle:%d %d %d %d", x1, y1, x2, y2); |
| 460 | return 0; |
| 461 | } |
| 462 | // if (_capture) { |
| 463 | // if (_display == RDT_NORMAL) {//cap rect |
| 464 | // _capture->rect.left = x1; |
| 465 | // _capture->rect.top = y1; |
| 466 | // _capture->rect.right = x2; |
| 467 | // _capture->rect.bottom = y2; |
| 468 | // } |
| 469 | // else { |
| 470 | // _capture->rect.left = 0; |
| 471 | // _capture->rect.top = 0; |
| 472 | // _capture->rect.right = _capture->get_width(); |
| 473 | // _capture->rect.bottom =_capture->get_height(); |
| 474 | // } |
| 475 | // |
| 476 | // } |
| 477 | return 1; |
| 478 | } |
| 479 | |
| 480 | long BindingSession::get_image_type() { |
| 481 |
no test coverage detected