请问: 如何从一个HDC中得到其中的Region句柄或者RegionData? 我知道有个API: GetClipRgn,可它只能得到SelectClipRgn进取的Rgn数据, 
不能得到系统创建的Region数据。 
我找遍了API,就是不知道有什么办法,
各位GDI高手请帮忙出手,这是苦恼我N久的问题,本来想不麻烦大家自己看书找找,可就是找不到,我怀疑是不是GDI根本没有提供解决之道。 

解决方案 »

  1.   

    我不知道Region句柄是否有句柄,我认为Region只是一个区域,也就是不是一个窗口对象,就不会有句柄。他只不过是画布上的个区域而已,也就是说你只能取得这个区域的大小,颜色等数据
      

  2.   

    API: InvalidateRgnBOOL InvalidateRgn(
        HWND hWnd, // handle of window with changed update region  
        HRGN hRgn, // handle of region to add
        BOOL bErase  // erase-background flag
    );其中hRgn的解释就是Handle of region to add,如果我没搞错的话,handle在这里应该
    翻译成句柄吧?
      

  3.   

    还有这个,用来得到标识当前指定DC的Clipping Region的handle,也叫句柄吧?
    The GetClipRgn function retrieves a handle identifying the current application-defined clipping region for the specified device context. int GetClipRgn(    HDC hdc, // handle of device context  
        HRGN hrgn  // handle of region 
       );
     ParametershdcIdentifies the device context. hrgnIdentifies an existing region before the function is called. After the function returns, this parameter identifies a copy of the current clipping region.  Return ValuesIf the function succeeds and there is no clipping region for the given device context, the return value is zero. If the function succeeds and there is a clipping region for the given device context, the return value is 1. If an error occurs, the return value is - 1. ResAn application-defined clipping region is a clipping region identified by the SelectClipRgn function. It is not a clipping region created when the application calls the BeginPaint function. 
    If the function succeeds, the hrgn parameter identifies a copy of the current clipping region. Subsequent changes to this copy will not affect the current clipping region. See AlsoBeginPaint, SelectClipRgn