⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_21000.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:21000 发表者:李冰 发表日期:2002-11-12 20:59:00
<br>主题:怎么将两个多边形区域合成一个区域?
<br>内容:怎么将两个多边形区域合成一个区域?
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:李冰 回复日期:2002-11-12 21:52:51
<br>内容:如在一个RECT中间画一条曲线,分成两个RGN,然后再合成一个RGN,也就是得到开始那个RECT
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:Norton AntiVirus 回复日期:2002-11-13 08:42:50
<br>内容:CRgn::CombineRgn <BR>int CombineRgn( CRgn* pRgn1, CRgn* pRgn2, int nCombineMode );<BR><BR>Return Value<BR><BR>Specifies the type of the resulting region. It can be one of the following values: <BR><BR>COMPLEXREGION&nbsp;&nbsp; New region has overlapping borders.<BR><BR><BR>ERROR&nbsp;&nbsp; No new region created.<BR><BR><BR>NULLREGION&nbsp;&nbsp; New region is empty.<BR><BR><BR>SIMPLEREGION&nbsp;&nbsp; New region has no overlapping borders. <BR>Parameters<BR><BR>pRgn1<BR><BR>Identifies an existing region.<BR><BR>pRgn2<BR><BR>Identifies an existing region.<BR><BR>nCombineMode<BR><BR>Specifies the operation to be performed when combining the two source regions. It can be any one of the following values: <BR><BR>RGN_AND&nbsp;&nbsp; Uses overlapping areas of both regions (intersection).<BR><BR><BR>RGN_COPY&nbsp;&nbsp; Creates a copy of region 1 (identified by pRgn1).<BR><BR><BR>RGN_DIFF&nbsp;&nbsp; Creates a region consisting of the areas of region 1 (identified by pRgn1) that are not part of region 2 (identified by pRgn2).<BR><BR><BR>RGN_OR&nbsp;&nbsp; Combines both regions in their entirety (union).<BR><BR><BR>RGN_XOR&nbsp;&nbsp; Combines both regions but removes overlapping areas. <BR>Remarks<BR><BR>Creates a new GDI region by combining two existing regions. The regions are combined as specified by nCombineMode. <BR><BR>The two specified regions are combined, and the resulting region handle is stored in the CRgn object. Thus, whatever region is stored in the CRgn object is replaced by the combined region. <BR><BR>The size of a region is limited to 32,767 by 32,767 logical units or 64K of memory, whichever is smaller. <BR><BR>Use CopyRgn to simply copy one region into another region. <BR><BR>Example<BR><BR>CRgn&nbsp;&nbsp; rgnA, rgnB, rgnC;<BR><BR>VERIFY(rgnA.CreateRectRgn( 50, 50, 150, 150 ));<BR>VERIFY(rgnB.CreateRectRgn( 100, 100, 200, 200 ));<BR>VERIFY(rgnC.CreateRectRgn( 0, 0, 50, 50 ));<BR><BR>int nCombineResult = rgnC.CombineRgn( &amp;rgnA, &amp;rgnB, RGN_OR );<BR>ASSERT( nCombineResult != ERROR || nCombineResult != NULLREGION );<BR><BR>CBrush br1, br2, br3;<BR>VERIFY(br1.CreateSolidBrush( RGB(255, 0, 0) ));&nbsp;&nbsp;// rgnA Red<BR>VERIFY(pDC-&gt;FrameRgn( &amp;rgnA, &amp;br1, 2, 2 ));<BR>VERIFY(br2.CreateSolidBrush( RGB(0, 255, 0) ));&nbsp;&nbsp;// rgnB Green<BR>VERIFY(pDC-&gt;FrameRgn( &amp;rgnB, &amp;br2, 2, 2 ));<BR>VERIFY(br3.CreateSolidBrush( RGB(0, 0, 255) ));&nbsp;&nbsp;// rgnC Blue<BR>VERIFY(pDC-&gt;FrameRgn( &amp;rgnC, &amp;br3, 2, 2 ));<BR><BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -