Skip to content

Commit

Permalink
fix: 修复DirectX模式下会弹C++
Browse files Browse the repository at this point in the history
  • Loading branch information
Sallee1 committed Jun 2, 2023
1 parent 66302b2 commit 28db882
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cvAutoTrack/src/capture/dxgi/Dxgi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,11 @@ bool Dxgi::capture(cv::Mat& frame)

// 将画面转换为OpenCV的Mat
frame = cv::Mat(frame_size.Height, frame_size.Width, CV_8UC4, (void*)data, pitch);
if (client_box_available)
{
frame = frame(cv::Rect(0, 0, client_box.right - client_box.left, client_box.bottom - client_box.top));
}
if (client_box_available)
{
frame = frame(cv::Rect(0, 0, client_box.right - client_box.left, client_box.bottom - client_box.top));
}
frame = frame.clone();
// 释放资源
bufferTexture->Release();
return true;
Expand Down

0 comments on commit 28db882

Please sign in to comment.