RadzPrower / Zelda-3-Launcher

An all-purpose GUI tool to download, extract, compile, and launch Zelda 3 on PC.
MIT License
277 stars 12 forks source link

Keymapper Utility controller image size mismatch. #36

Closed impeeza closed 11 months ago

impeeza commented 1 year ago

Hello there on my PC the Keymapper utility the controller picture is the wrong size.

image

The green arrow shows the border of controller image, and the yellow one shows the container limit.

My display settings are:

image

Changing the Display DPI also change the display of Keymapper controller image: image

may be code should be added to resize the controller image to the appropriate size of the container and take in account the DPI of the display.

putting my display to 100% scale the image is shown correctly:

image

RadzPrower commented 1 year ago

Scaling is not exactly a critical concern considering it is a non-standard scenario, but next time I load up the code, I'll see if there's a simple solution.

impeeza commented 1 year ago

Thank you, I did try to look into the code but I haven programmed so long time what I didn't understand anything :D

back on my days the code was on the load method of the form, but today I got lost. 🤣

impeeza commented 1 year ago

Today tried to dust off my programming knowledge and even if Visual Studio is making me crazy, I managed to find the only little change needed:

The «PictureController» object is the picture container and have a property called «SizeMode» which is on «AutoSize»: image On this mode the image keeps his original size.

but if you change it to «StretchImage»: image the image get automatically the size of the container, and as Windows Forms is taking care of autoscale all forms components the image is drawn on all DPIs correctly: image image

image

The only change needed on the source code is:

line 108 on «keymapper.Designer.cs» file:

image

do you mind if I create a PR?

RadzPrower commented 1 year ago

I'm curious what version of Windows you are running?

I've changed the scaling on my PC and it's properly scaling at 125% and 150%. I'd rather not simply change to StretchImage since it appears from your screenshots that it's not maintaining aspect ratio.

impeeza commented 1 year ago

I'm curious what version of Windows you are running?

I've changed the scaling on my PC and it's properly scaling at 125% and 150%. I'd rather not simply change to StretchImage since it appears from your screenshots that it's not maintaining aspect ratio.

Hello there. I am on windows 11 and both of my pcs have the same behavior

RadzPrower commented 1 year ago

I'm also on Windows 11 and I can push it to absurd levels of scaling and it's just fine: image

So, I am not sure what is causing the different behavior between our machines.

impeeza commented 1 year ago

I don't know, may be the monitor? will test this night with others monitors, resolutions, etc.

I am using only 1080 res far now.

impeeza commented 1 year ago

Just connect a 4K monitor to my PC and my Laptop and found what on any resolution bigger than 1920X1080 do not matters which scale you select the picture is drawn correctly.

But for all resolutions equal and lower than 1920X1080 if you select a scale bigger than 100% the controller image get at wrong size. And with a scale of 100% the image is perfect.

Only happens with 1920X1080 or smaller resolutions.

It's Wired.

Tested on my Laptop and Desktop Windows 11 22621.2215 build

RadzPrower commented 1 year ago

I'll see if lowering my resolution will let me at least replicate and see about finding a way to fix it while maintaining aspect ratio.

impeeza commented 1 year ago

thank you

RadzPrower commented 1 year ago

image Even at a lower resolution (as low as 1280x720) and with scaling up to 175% I have not seen the odd resizing issue.

impeeza commented 1 year ago

he he he, should be my PCs are haunted! let see if somebody is experiencing the same but for now put a pin on the issue.

Thanks a lot for your help and work.

RadzPrower commented 1 year ago

I'd be curious to see if it's a particular graphics card, brand, or even driver version that's the culprit.

impeeza commented 1 year ago

Maybe, I have:

PC:

Laptop:

RadzPrower commented 1 year ago

PC drivers seem up-to-date while the Laptop is one version behind, but the problem is present in both. The laptop Windows 11 version is the same as mine and the PC one is actually higher.

As far as I can tell, the most likely culprit at this point would be the Intel hardware itself. I don't have anything with an Intel chipset to verify though.