视图类中的ONDRAW(CDC *PDC)中的PDC. 如果用其画图, PDC表示的是哪个区域? 是屏幕区域, 窗口区域? 还是这个视图的区域? ONPAINT( )中的CPAINTDC DC(THIS)中的DC指的又是哪个区域?窗口类中的ONPAINT( )中的CPAINTDC DC(THIS)指的是哪个画图区域?一般在视图类ONDRAW( )中使用双缓冲时, 声明一个内存DC, 即CDC MEMDC; 其中MEMDC.CREATECOMPATIBLEDC(NULL); 为什么使用NULL为参数, 用NULL创建出来的DC有什么特别的地方? 它的大小为多少? 为什么不使用ONDRAW(CDC *PDC)中的参数PDC.

解决方案 »

  1.   

    PDC表示的是设备,不是区域。比如屏幕、打印机等输出设备。
      

  2.   

    你使用双缓存,当然不能直接使用ONDRAW(CDC *PDC)中的参数PDC,这样的话就失去了双缓存的意义了。
      

  3.   

    pDC指的是设备, 但是画图的时候应该有一个相对的画图区域, 也就是(0, 0)坐标是相对于屏幕? 还是客户区. 画图就要有个坐标系. pDC是用在CreateCompatibleDC函数中的.
      

  4.   

    双缓冲是新建一个和pDC所知兼容的内存dc,在内存dc上绘图,再BitBlt到pDC所指的设备
    如果直接在pDC上绘,就不是双缓冲了
      

  5.   

    区域是RECT结构,要获得用户区,可以GetClientRect();
      

  6.   

    The CDC class defines a class of device-context objects. The CDC object provides member functions for working with a device context, such as a display or printer, as well as members for working with a display context associated with the client area of a window.
    For specific uses, the Microsoft Foundation Class Library provides several classes derived from CDC . CPaintDC encapsulates calls to BeginPaint and EndPaint. CClientDC manages a display context associated with a window's client area. CWindowDC manages a display context associated with an entire window, including its frame and controls. CMetaFileDC associates a device context with a metafile.