Jeff 4 lat temu
rodzic
commit
2277e1fc1f

+ 11 - 12
GameAssist/GameAssist/Assist.cpp

@@ -8,8 +8,6 @@
 // #pragma comment(lib, "d3d11.lib")
 // #pragma comment(lib, "dxgi.lib")
 
-int frameWidth = 2;
-int titleBarHeight = 27;
 
 namespace GAssist
 {
@@ -1750,9 +1748,10 @@ namespace GameAssist
 	}
 };
 
-namespace GameGlobal {
-	int frameWidth = 2;
-	int titleBarHeight = 27;
+namespace GameGlobal 
+{
+	int frameWidth = 2;//6
+	int titleBarHeight = 27;//29
 
 	TCHAR g_szCurModuleFileName[MAX_PATH];
 	TCHAR g_szCurModuleDir[MAX_PATH];
@@ -1975,10 +1974,10 @@ namespace ImgAssist
 
 		cv::Rect roi = cv::Rect(lv_nMaxLoc.x, lv_nMaxLoc.y, tempImg.cols, tempImg.rows);
 		cv::Mat roiImg = srcImg(roi);
-		cv::imwrite(GameGlobal::BuildImgPath(hWnd, _T("match.bmp")), roiImg);
+		cv::imwrite(GameGlobal::BuildImgPath(hWnd, _T("match")), roiImg);
 
-		rc.left = lv_nMaxLoc.x - frameWidth;
-		rc.top = lv_nMaxLoc.y - titleBarHeight;
+		rc.left = lv_nMaxLoc.x - GameGlobal::frameWidth;
+		rc.top = lv_nMaxLoc.y - GameGlobal::titleBarHeight;
 		rc.right = rc.left + tempImg.cols;
 		rc.bottom = rc.top + tempImg.rows;
 
@@ -2016,8 +2015,8 @@ namespace ImgAssist
 		cv::Mat roiImg = srcImg(roi);
 		//cv::imwrite("G:\\bin\\GameAssist\\match.bmp", roiImg);
 
-		rc.left = lv_nMaxLoc.x - frameWidth;
-		rc.top = lv_nMaxLoc.y - titleBarHeight;
+		rc.left = lv_nMaxLoc.x - GameGlobal::frameWidth;
+		rc.top = lv_nMaxLoc.y - GameGlobal::titleBarHeight;
 		rc.right = rc.left + tempImg.cols;
 		rc.bottom = rc.top + tempImg.rows;
 
@@ -2067,8 +2066,8 @@ namespace ImgAssist
 		cv::Mat roiImg = imgROI(roi);
 		cv::imwrite(GameGlobal::BuildImgPath(hWnd, _T("match")), roiImg);
 
-		matchRect.left = srcRect.left + lv_nMaxLoc.x - frameWidth;
-		matchRect.top = srcRect.top + lv_nMaxLoc.y - titleBarHeight;
+		matchRect.left = srcRect.left + lv_nMaxLoc.x - GameGlobal::frameWidth;
+		matchRect.top = srcRect.top + lv_nMaxLoc.y - GameGlobal::titleBarHeight;
 		matchRect.right = matchRect.left + tempImg.cols;
 		matchRect.bottom = matchRect.top + tempImg.rows;
 

+ 6 - 0
GameAssist/GameAssist/GameAssistDlg.cpp

@@ -1121,6 +1121,7 @@ BOOL CGameAssistDlg::OnInitDialog()
 
 	// TODO: 在此添加额外的初始化代码
 	GAssist::Init();
+	GameGlobal::Init();
 	InitZYNPC();
 
 	int nIndex = 0;
@@ -1991,4 +1992,9 @@ void CGameAssistDlg::OnBnClickedButton14()
 	GameAssist::MouseMove(pt);
 	GameAssist::MouseClick();
 #endif
+
+	if (1)
+	{
+		ImgAssist::CaptureGameWnd(hWnd);
+	}
 }