Dealing with Windows Scaling

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Dealing with Windows Scaling

Post by Phil Pendlebury » Fri May 20, 2022 6:42 pm

I have an app that works fine on my system:

Image

But on a user's system it looks like this:

Image

Does anyone have any ideas how to deal with this?

I noticed a thread somewhere that looked like it dealt with Windows scale sizes. (Cannot find it now).

But would that mean changing graphics for every possible scale?

Also more importantly - Notice the memo field doe not look correct either.

Any thoughts appreciated. :-)
Phil Pendlebury - Linktree

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Re: Dealing with Windows Scaling

Post by Phil Pendlebury » Sat May 21, 2022 7:32 am

Ok I found a post about scaling and added some info:

Code: Select all

// 96 – Smaller 100%
// 120 – Medium 125%
// 144 – Larger 150%
// 192 – Extra Large 200%
// 240 – Custom 250%
// 288 – Custom 300%
// 384 – Custom 400%
// 480 – Custom 500%

LibFunc>User32,GetDC,hDC,0
LibFunc>GDI32,GetDeviceCaps,Result,hDC,88

// Test (300% Scaled)
Let>Result=288

Let>ResBy96=Result/96
Let>ResPerc=ResBy96*100
messagemodal>%ResPerc%% is the scaling factor

// So if a box is 50x60
// and you ned to scale it
Let>xboxdim=50
Let>yboxdim=60
//
Let>xboxdimx=xboxdim/100
Let>xboxdimx=xboxdimx*ResPerc
Let>yboxdimy=yboxdim/100
Let>yboxdimy=yboxdimy*ResPerc

MDL>Original x: %xboxdim% will now be: %xboxdimx%%CRLF%Original y: %yboxdim% will now be: %yboxdimy%
Phil Pendlebury - Linktree

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Re: Dealing with Windows Scaling

Post by Phil Pendlebury » Sat May 21, 2022 7:50 am

So for the memo field we only need to adjust height:

Code: Select all

GetDialogProperty>Dialog1,MSMemo1,Height,memoheight
Let>xboxdimx=memoheight/100
Let>xboxdimx=xboxdimx*ResPerc
SetDialogProperty>Dialog1,MSMemo1,Height,xboxdimx
For graphics I think we need different res graphics for all percentages.
Phil Pendlebury - Linktree

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Re: Dealing with Windows Scaling

Post by Phil Pendlebury » Sat May 21, 2022 7:50 am

So for the memo field we only need to adjust height:

Code: Select all

GetDialogProperty>Dialog1,MSMemo1,Height,memoheight
Let>xboxdimx=memoheight/100
Let>xboxdimx=xboxdimx*ResPerc
SetDialogProperty>Dialog1,MSMemo1,Height,xboxdimx
For graphics I think we need different res graphics for all percentages.
Phil Pendlebury - Linktree

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Re: Dealing with Windows Scaling

Post by Phil Pendlebury » Sat May 21, 2022 8:03 am

And for graphics we need to do this, after making different graphics for each resolution and naming them for example 100logo.jpg 125logo.jpg etc.:

Code: Select all

SetDialogProperty>Dialog1,MSImage1,LoadImage,%SCRIPT_DIR%/%logos%/%ResPerc%logo.jpg
Phil Pendlebury - Linktree

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts