CDC *pDC
我用什么函数才能获得这个pDC的长宽?

解决方案 »

  1.   

    不是从DC中获得,是用GetClientRect(hWnd,RECT)来得到某个窗体的尺寸。
    然后根据RECT就可以得到长宽
      

  2.   

    看你是什么CDC了,有CWindowDC,有CClientDC,CPaintDC,不同的CDC他允许你
    的gdi函数操作范围是不一样的!
      

  3.   

    GetDeviceCaps
    DC的一些参数都在这里了
      

  4.   

    GetBoundsRect
    The GetBoundsRect function obtains the current accumulated bounding rectangle for a specified device context. The system maintains an accumulated bounding rectangle for each application. An application can retrieve and set this rectangle.