OFFICE/프로그램

CRgn클래스를 이용한 영역표시?

gandus 2011. 10. 24. 19:45
CRgn rgn;
HRGN hMyRgn;


CPoint poly[4];
CPoint point;
GetCursorPos(&point);
GetDlgItem(IDC_STATIC_VIEW)->ScreenToClient(&point); 


rgn.CreatePolygonRgn(poly, 4, WINDING);


rgn.PtInRegion(point)
-> 영역안을 침범했는지, 침범했다면 참값,  아니라면 거짓.



hMyRgn = (HRGN) rgn;
rgn.DeleteObject();