各位:
  我想用windows的api判断一个点是否在一个rgn内。好像有个这个的函数ptinrgn(),但是我找了很多地方都找不到这个函数的参数细节。是不是这个函数只在mfc里面才实现了???如果哪位知道麻烦把这个函数的具体细节(主要是如何传递参数)告诉我好吗?
  麻烦各位给小弟一个解决方法好吗?多谢 多谢!

解决方案 »

  1.   

    BOOL PtInRegion(
      HRGN hrgn,  // handle to region
      int X,      // x-coordinate of point
      int Y       // y-coordinate of point
    );windows api函数
      

  2.   

    Windows GDI 
    PtInRegion
    The PtInRegion function determines whether the specified point is inside the specified region. BOOL PtInRegion(
      HRGN hrgn,  // handle to region
      int X,      // x-coordinate of point
      int Y       // y-coordinate of point
    );
    Parameters
    hrgn 
    [in] Handle to the region to be examined. 

    [in] Specifies the x-coordinate of the point in logical units. 

    [in] Specifies the y-coordinate of the point in logical units. 
    Return Values
    If the specified point is in the region, the return value is nonzero.If the specified point is not in the region, the return value is zero. 
      

  3.   


    BOOL PtInRegion(int x, int y) const
    {
    ATLASSERT(m_hRgn != NULL);
    return ::PtInRegion(m_hRgn, x, y);
    }