Posted: Sat Jun 15, 2024 1:33 pm Post subject: Help with getting Display Scaling work!
When I save a trainer as an EXE and run it. The Display Scaling never works unless I set the High DPI Scaling Override to System on the EXE. I've tried a bunch of things and nothing seems to work. Is there some setting I need to enable to get this working without having to enable the Override? I've tried turning DPI Aware On/Off and set the main form Scaled to True/False. I would really like to get it working without having to enable the Override. Thanks!
if myForm1 then myForm1.Destroy() myForm1=nil end
myForm1=createForm()
myForm1.PopupMode=0 myForm1.caption="Test DPI Form1"
myForm1.Position="poDesktopCenter" myForm1.ShowInTaskBar="stAlways"
myForm1.BorderStyle="bsSingle"
for l,k in pairs(UDF1) do
formCompTbl[#formCompTbl + 1] = UDF1[l].width
formCompTbl[#formCompTbl + 1] = UDF1[l].height
formCompTbl[#formCompTbl + 1] = UDF1[l].left
formCompTbl[#formCompTbl + 1] = UDF1[l].Top
formCompTbl[#formCompTbl + 1] = UDF1[l].Font.Size
end
function checkDPI()
local res = 0
compIndex = 0
for l,k in pairs(UDF1) do
res = 0
for n,m in pairs(formCompTbl) do
if res==0 then
UDF1[l].width = formCompTbl[compIndex + 1] * DP1
UDF1[l].height = formCompTbl[compIndex + 2] * DP1
UDF1[l].left = formCompTbl[compIndex + 3] * DP1
UDF1[l].Top = formCompTbl[compIndex + 4] * DP1
UDF1[l].Font.Size = formCompTbl[compIndex + 5] * DP1
compIndex = tonumber(compIndex) + 5
res = 1
end
end
end
end
UDF1.CEButton1.OnClick=function()
DP1=getScreenDPI()/72
myForm1.height=400 * DP1
myForm1.width=500 * DP1
checkDPI()
end
UDF1.CEButton2.OnClick=function()
DP1=getScreenDPI()/getScreenDPI()
myForm1.height=400 * DP1
myForm1.width=500 * DP1
checkDPI()
end
UDF1.CEButton3.OnClick=function()
DP1=getScreenDPI()/50
myForm1.height=400 * DP1
myForm1.width=500 * DP1
checkDPI()
end
UDF1.CEButton4.OnClick=function()
DP1=getScreenDPI()/110
myForm1.height=400 * DP1
myForm1.width=500 * DP1
checkDPI()
end
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum