pDC->BeginPath(); // 1pDC->Polyline(m_ZbPoints, 5);pDC->EndPath(); // 2
PathToRegion(*pDC); // 3
pDC->FillPath(); // 4没有上面注释的是可以画空的多边形。 反而加了 // 1 2 3 4 后 
变成透明了, 我DC选择过画涮的。不知,有什么原因会这样。

解决方案 »

  1.   

    After PathToRegion converts a path into a region, the system discards the closed path from the specified device context.
      

  2.   

    pDC->FillPath(); // 4 
    之前添加pDC->SelectClipPath试试看
      

  3.   

    pDC->BeginPath(); // 1 
    CPoint m_ZbPoints[4] = {CPoint(0,0),CPoint(100,100),CPoint(40,0),CPoint(100,0)};
    pDC->Polyline(m_ZbPoints, 4); 
    pDC->EndPath();
    pDC->SelectObject(CreateSolidBrush(RGB(255,0,0)));
    pDC->FillPath();上面这段代码,我测试了一下,是可以显示的
      

  4.   

    我把PathToRegion(*pDC); // 3  
    屏蔽掉了 就可以显示了!!??
      

  5.   

    PathToRegion后path就不存在了,变成了region.当然FillPath就没有了。