Browse Source

变量到opencv4.7版本。

Jeff 1 year ago
parent
commit
45e0045dc4
1 changed files with 5 additions and 6 deletions
  1. 5 6
      GameAssist/GameAssist/GameAssistDlg.cpp

+ 5 - 6
GameAssist/GameAssist/GameAssistDlg.cpp

@@ -378,18 +378,17 @@ void CGameAssistDlg::OnBnClickedButton2()  // 
 	INT nY2 = GetDlgItemInt(IDC_EDIT6);
 	BOOL bCropPicture = ((CButton*)GetDlgItem(IDC_CHECK5))->GetCheck();
 
+	TCHAR szImg[MAX_PATH] = {0};
 	if (bCropPicture)
 	{
-		std::string strImg = GameGlobal::g_szTempDir;
-		strImg.append(_T("²Ã¼ô½á¹û.bmp"));
-		ImgAssist::CropPicture(hWnd, { nX, nY, nX2, nY2 }, strImg.c_str());
+		_stprintf_s(szImg, _T("%s²Ã¼ô-%ld.bmp"), GameGlobal::g_szTempDir, GetTickCount64());
+		ImgAssist::CropPicture(hWnd, { nX, nY, nX2, nY2 }, szImg);
 	}
 	else
 	{
-		std::string strImg = GameGlobal::g_szTempDir;
-		strImg.append(_T("½Øͼ½á¹û.bmp"));
+		_stprintf_s(szImg, _T("%s½Øͼ-%ld.bmp"), GameGlobal::g_szTempDir, GetTickCount64());
 		cv::Mat srcImg = ImgAssist::CaptureWnd(hWnd);
-		cv::imwrite(strImg.c_str(), srcImg);
+		cv::imwrite(szImg, srcImg);
 	}
 }