请问各位:如果已知两个图形的边界,不知道有没有一个函数来求他们的差?
如果没有这样的函数,在作动画时,A区域的一部分被B区域覆盖后,我想得到A区域没有被覆盖部分的图形,如何才能办到?先谢谢了。

解决方案 »

  1.   

    使用mask
    去搜索吧,论坛里面有
      

  2.   

    参见MSDN内说明CombineRgn
    The CombineRgn function combines two regions and stores the result in a third region. The two regions are combined according to the specified mode. int CombineRgn(
      HRGN hrgnDest,      // handle to destination region
      HRGN hrgnSrc1,      // handle to source region
      HRGN hrgnSrc2,      // handle to source region
      int fnCombineMode   // region combining mode
    );
    使用下面参数中的RGN_DIFF即可:
    RGN_AND Creates the intersection of the two combined regions. 
    RGN_COPY Creates a copy of the region identified by hrgnSrc1. 
    RGN_DIFF Combines the parts of hrgnSrc1 that are not part of hrgnSrc2. 
    RGN_OR Creates the union of two combined regions. 
    RGN_XOR Creates the union of two combined regions except for any overlapping areas. 
      

  3.   

    谢谢阿呆,采用CombineRgn后,边数不同实时好像不能通过,
    如何知道合并后图形的边数?