|
if (Xcenter<=45)
{
Label2->Caption="오른쪽";
mpx+=2;
SetCursorPos(mpx,mpy); //
}
else if (Xcenter>=75)
{
mpx-=2;
SetCursorPos(mpx,mpy); //
Label2->Caption="왼쪽";
}
else
{
Label2->Caption="바른자세";
}
영상인식 소스중의 한 부분인데요
밑에의 마우스 자동클릭 소스를 이용하여
각도를 기울여서(왼쪽으로 기울여서 영상이 인식하면 특정부위를 클릭)
할수 있게 만들고 싶은데요..
어떻게 방법이 없을까요? 답을 못찾아서 올립니다..
(마우스 자동클릭 소스부분입니다.)
Application->ProcessMessages();
// Get the point in the center of button 1
TPoint Pt;
Pt.x=1600;
Pt.y=2000;
mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, Pt.x, Pt.y, 0, 0);
// Simulate the left mouse button down
mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_LEFTDOWN, Pt.x, Pt.y, 0, 0);
// Simulate the left mouse button up
mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_LEFTUP, Pt.x, Pt.y, 0, 0);
|