PHP Code:
!include LogicLib.nsh
System::Call USER32::GetDpiForSystem()i.r0
${If} $0 U<= 0
System::Call USER32::GetDC(i0)i.r1
System::Call GDI32::GetDeviceCaps(ir1,i88)i.r0
System::Call USER32::ReleaseDC(i0,ir1)
${EndIf}
MessageBox mb_ok SysDpi=$0
and extract with a size based on
https://msdn.microsoft.com/en-us/lib...px#CLOSEST_FIT
Quote:
int iSourceImageDPIToUse = 96; // We will assume 96 by default.
if (gDPI > 144)
iSourceImageDPIToUse = 192;
else if (gDPI > 120)
iSourceImageDPIToUse = 144;
else if (gDPI > 96)
iSourceImageDPIToUse = 120;
|