locked
GetDeviceCaps not give the correct pixel factor in windows 7 RRS feed

  • General discussion

  • GetDeviceCaps not give the correct pixel factor in windows 7 , if i use the dpi settings 96 means it give the pixel factor as 1 , and if i user the dpi settings 120 means it should give the 1.25 pixel factor, in windows xp i got correct factor with GetDeviceCaps but in window7 it returns the pixel factor 1 instead of 1.25, can anyony help for this problem

    ScreenDC = ::CreateDC("DISPLAY",NULL,NULL,NULL);
    ScreenDPI.x = GetDeviceCaps(ScreenDC,LOGPIXELSX);
    float PixelFactorX =  (float)ScreenDPI.x/96;

    • Changed type Nicholas Li Monday, September 10, 2012 10:17 AM
    Wednesday, August 8, 2012 4:00 AM

All replies

  • Hi,

    For code issue, I would like suggest you post it to MSDN forum  to get more professional help.

    Thank you for your understanding

    Thursday, August 9, 2012 9:25 AM