如何得到当前画图指针pDC的颜色?调用什么函数?

解决方案 »

  1.   

    GetBrush, then GetLogBrush。Color is in the LOGBRUSH struct
    or, GetPen, then GetLogPen。Color is in the LOGPEN struct
      

  2.   

    GetLogBrush is a member function of CBrush
    GetLogPen is a member function of CPen
      

  3.   

    COLORREF MYSHAPE::GetDCColor(CDC *pDC)
    {
      CPen *mypen=pDC->GetCurrentPen();
      LOGPEN mylogpen;
      mypen->GetLogPen(&mylogpen);
      return mylogpen.lopnColor;
    }
    行了,问题解决了,谢谢!!