我的窗口上有个picture控件,我要在这个控件之中显示图像,我用
CWnd* pWnd=GetDlgItem(IDC_PICTURE)
CDC* pDC=pWnd->GetDC()
我想知道我用pDC->GetDeviceCaps(LOGPIXELX)这个函数得到的是picture区域的象素个数,还是整个显示屏区域的象素个数

解决方案 »

  1.   

    按理说应该是picture区域的像素数了。
      

  2.   

    GetDeviceCaps(int nIndex )函数来获取当前显示屏幕的尺寸,nIndex取LOGPIXELSX值可以得到屏幕的宽度(以像素为单位),取LOGPIXELSY值可以得到屏幕的高度。
      

  3.   

    我想应该有个int型的返回值,在该句设置断点,F5运行,看看返回值就知道了嘛!
      

  4.   

    GetDeviceCaps(int nIndex )
    LOGPIXELX
    Number of pixels per logical inch along the screen width. In a system with multiple display monitors, this value is the same for all monitors.
    沿着屏幕宽度,每个逻辑英寸的像素值数目。在多监视器系统中,对所有的监视器它的值相同。