Home > Software engineering >  VC how to obtain the system changes to the text, the application and other proportion to the size of
VC how to obtain the system changes to the text, the application and other proportion to the size of

Time:10-29

VC as shown in figure: how to get to change the text, the size of the application and other projects, 150% digital


CodePudding user response:

Please search before questions
https://msdn.microsoft.com/windows/hardware/commercialize/manufacture/desktop/dpi-related-apis-and-registry-settings

CodePudding user response:

 float GetScreenZoomScaleWidth () 
{
Float dbZoomScale=1.0;

HDC desktopDc=CreateDC (_T (" display "), NULL, NULL, NULL);
//Get native resolution
Int horizontalDPI=GetDeviceCaps (desktopDc LOGPIXELSX);

DbZoomScale=horizontalDPI/96.0 f;

Return dbZoomScale;
}

Float GetScreenZoomScaleHeight ()
{
Float dbZoomScale=1.0;

HDC desktopDc=CreateDC (_T (" display "), NULL, NULL, NULL);
//Get native resolution
Int verticalDPI=GetDeviceCaps (desktopDc, LOGPIXELSY);

DbZoomScale=verticalDPI/96.0 f;

Return dbZoomScale;
}


I put the monitor set to 150%, the two function called, or 96, restart the machine also not line, check the registry, found in the registration or 96, excuse me what method can solve, to get the correct value?
  • Related