MFC PtInRegion

来源:互联网 发布:超牛数据恢复免费软件 编辑:程序博客网 时间:2024/05/17 23:24

void CEasySizeDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
CRgn rgn;
CPoint VertexPoint[3];
// To Create The Triangle Window.
VertexPoint[0].x = 100; VertexPoint[0].y = 0;
VertexPoint[1].x = 0; VertexPoint[1].y = 100;
VertexPoint[2].x = 100; VertexPoint[2].y = 100;
rgn.CreatePolygonRgn(VertexPoint, 3, ALTERNATE);

if(PtInRegion(rgn,point.x,point.y)){    MessageBox(_T("test"));}CDialogEx::OnLButtonDown(nFlags, point);

}

0 0