Code: Select all
#Persistent Gui , New Gui , Add , Text , x10 y10 w110, % "A_ScreenDPI: " . A_ScreenDPI ImageWidth := Round(178 * 1.25) ImageHeight := Round(41 * 1.25) Gui , -DPIScale Gui , Add , Picture , x50 y40 w%ImageWidth% h%ImageHeight% AltSubmit, %A_ScriptDir%\PayPalButton.png ;https://i.lensdump.com/i/ArO2Cz.png Gui , Show , w300 return
Things I have tried so far:
1. Setting -DPIScale just before adding the image
2. Setting AltSubmit option to make it use GDI+ instead of GDI
3. Adding the picture using LoadImage() with/without GDI+ and passing handle to Gui , Add , Picture
4. Setting "Use windows XP style scaling" checked/unchecked in windows control panel
Nothing works, Windows just steamrolls over everything with its nearest neighbour garbage!!!
Thankfully this doesn't happen in Windows 10, but quite a lot of people still use Windows 7 so it's still not really acceptable if this is how it is on all Windows 7 machines. I googled this extensively and couldn't find a single blog post or article that talks about what scaling mode Windows 7 uses for dpi upscaling of images and icons.
It appears GDI+ has a function that sets the scaling mode, however we don't seem to have any way of calling that function - or do we? Can anyone more knowledgeable confirm this?
Also if someone could confirm that they are also getting forced nearest neighbour scaling on everything in Win7, please reply. To test it just set your Windows DPI to something other than 100%/96dpi (eg. 125%) which will then prompt you to log out and back in, and then load the script at top. If the image is all jagged and aliased then it's using nearest neighbour (i.e duplicating pixels instead of interpolating between them).