komefai / PS4Macro

Automation utility for PS4 Remote Play written in C#
http://blog.komefai.com
MIT License
378 stars 89 forks source link

Compensate for DPI Resolution and Remote Play Border #41

Open LaughDonor opened 6 years ago

LaughDonor commented 6 years ago

I have a 4k Laptop, and everything can run reallly tiny so I need to use DPI Scaling on my Windows 10 machine to enrich some experiences. This messes with the ScriptConfig.TargetSize as it won't be accurate when plugging in coordinates.

I feel that determining a multipler and adding to these lines would help. https://github.com/komefai/PS4Macro/blob/cf7ce2c4e49301a8d9d225798b499b29b37e41de/PS4MacroAPI/Internal/BackgroundCapture.cs#L63-L64

Since my Display Scaling is set to 200%, a multipler of 2 on both of these helped me.

The border is also not considered, so when trying to crop, you are offset by the left and top borders around the Remote Play window. If we can determine these values, we can get a coordinate system that's all aligned to the same axes.

komefai commented 6 years ago

Hi, I had this problem as well when I switched to a 4K monitor a few months ago, but I totally forget to add this in the documentation.

At first, I tried your approach by multiplying a scaling factor to the dimensions, but this becomes a problem when you distribute your script to other people with different scaling configurations!

So, the best solution to this problem is to find a way to force PS4 Remote Play to not scale with the OS. There are 2 cases for this, one for the latest Windows 10 update and another for the earlier Windows 10 update (2017 and earlier). If you're running the LATEST update then you should have this icon in your taskbar!

Task View Icon

Fix for latest Windows 10

  1. Right-Click on the PS4 Remote Play shortcut and select Properties
  2. Go to Compatibility tab
  3. Select High DPI scaling override to System

fixscaling

NOTE: If you're running an earlier Windows 10 that doesn't have the Task View icon, then choose override as System (Enhanced) instead.

Let me know if this helps!