ShareX / ShareX

ShareX is a free and open source program that lets you capture or record any area of your screen and share it with a single press of a key. It also allows uploading images, text or other types of files to many supported destinations you can choose from.
https://getsharex.com
GNU General Public License v3.0
28.11k stars 3.1k forks source link

HiDPI support in 4K Monitor Support #1477

Closed tx-trainwreck closed 3 years ago

tx-trainwreck commented 8 years ago

The current release (10.9.1) doesn't support high resolutions that are common in the PC industry right now. 4k monitor support for both the ShareX app as well as all other windows (ex. Image Editor) should be added.

Jaex commented 8 years ago

You mean high DPI? .NET should be able to support high DPI automatically.

tx-trainwreck commented 8 years ago

Yes... I forgot to include the high dpi clarifier. In my case, I'm running a 15" laptop at 3840x2160 at 200DPI. The arrows and menu entries on the taskbar icon are extremely small. It doesn't look like it's being scaled up correctly.

dasjestyr commented 8 years ago

Seconded. I haven't actually looked at the UI source, but I'm assuming that it's because it uses pixels instead of a relative measurement. Inherent winforms behavior? shrug

mstefarov commented 8 years ago

Having some inconsistent scale issues here too (see screenshot). Windows 10, ShareX 10.9.1, 3840x2160 display at "200%" (not sure what DPI that translates to).

iakat commented 8 years ago

It's indeed broken for HiDPI. Title's misleading; should be renamed to "HiDPI support".

Greenshot/the image editor does not support HiDPI, either.

handsomematt commented 8 years ago

http://i.imgur.com/VpAJ77f.jpg

Windows 10, ShareX 10.9.1, 2560x1600 display at "200%" scaling.

skalinets commented 7 years ago

Also, screenshots taken on different screens look differently. Just compare: 15' 4K laptop: http://i.imgur.com/wyYID4m.png 22' FullHD monitor: http://i.imgur.com/nOTwFgt.png Not sure if a separate ticket should be created for this.

detuur commented 7 years ago

@skalinets : That's correct behaviour. The text on the 4K monitor is rendered at much higher pixel density and as such has a higher resolution. Since computer images generally work with image sizes expressed in pixels, this means that viewing a 4K-density image on a HD-density screen will look blown up. In the opposite scenario, HD-density images on 4K screens will look tiny.

skalinets commented 7 years ago

@detuur: agree that it is correct from technical viewpoint. And also, speaking technically, there is nothing wrong with how sharex looks on high dpi screens. Pixels are pixels anyway. But I would like that application and screenshots were looking in the same way and size, regardless of your monitor resolution.

chriscamicas commented 7 years ago

I changed the manifest file from:

True/PM

to

True

And it's working as expected. My setup is Windows 10 + 3 monitors: 2x 1920x1080 (scale 100%) + 1x 4k (scale 250%) The application window handles scaling when changing monitor, in fact the system is handling the scaling for the app. If you set dpiAware to True/PM, you have to handle the scaling yourself in the app via WM_DPICHANGED Windows Message source Microsoft

BUT with dpiAware set to Tue, screen capture is not working correctly on my 4k monitor. The region is limited 1/4 approx. of my screen... it needs further investigation

Jaex commented 7 years ago

@chriscamicas I don't have multi monitor or high dpi monitor so I can't test and fix problems exist.

mstefarov commented 7 years ago

Microsoft just released improvements to "per-monitor DPI support" in .NET Framework 4.6.2, this may help with the issues people are having. More info here: https://github.com/Microsoft/WPF-Samples/tree/master/PerMonitorDPI

Jaex commented 7 years ago

@fragmer you showing WPF example but ShareX using Windows Forms.

pidzej commented 7 years ago

I have problem with HDPI too -> screen

ipwnall commented 7 years ago

Not much to add except that I also have the issue on my 4k laptop; I would attach a screenshot but it's just the same as pidzej above me. The program still has all it's functionality but it looks very weird and certian text is very difficult to see; for example the drop down arrows on the side menu look like single pixels unless you really squint (Note that on a 4k screen the linked screenshot is twice as small)

Jaex commented 7 years ago

.NET framework draws that drop down arrows itself how am I supposed to support high dpi in each control.

ipwnall commented 7 years ago

I have no clue I'm just reporting the problem. It's something I've seen other programs solve so there must be some solution.

dasjestyr commented 7 years ago

@ipwnall I'd put money on the fact that those other programs either used WPF, used custom controls, or were written in C++ (so everything was custom). I think the real blocker here is that this is a winforms app so a lot of that stuff will have to be solved by hand (if at all) and I'm assuming that is no easy task, but I don't have a strong background in UI.

The project seems to be pretty well broken out though; maybe it's time for a port/upgrade? It seems that most of the work would be in converting forms to views. I think the MVVM conversion would be optional, at least as a first pass.

jmunson commented 7 years ago

I just thought I'd contribute a few screenshots of what ShareX looks like on a 4k Dell XPS 15 9550 running windows 10

http://imgur.com/a/Hl4t5

Feel free to tag me if you need any potential fixes or workarounds tested.

dasjestyr commented 7 years ago

Adding to @jmunson screenshot, this is also a screen from my 4k Dell XPS 15

http://i.imgur.com/XUcFzUt.png

ittybittybuttons

nikhiljha commented 7 years ago

@Jaex

http://www.telerik.com/blogs/winforms-scaling-at-large-dpi-settings-is-it-even-possible-

https://stackoverflow.com/questions/4075802/creating-a-dpi-aware-application

https://stackoverflow.com/questions/26073635/windows-forms-dpi-scaling

Please implement, ShareX is near impossible to configure without it.

Of course the best solution is to move to WPF (you get a bunch of other goodies!), but any small fixes would be appreciated for now.

IlanVivanco commented 7 years ago

Same as @dasjestyr & @jmunson in my XPS 15 9550 XPS15

mstefarov commented 7 years ago

@Jaex .NET 4.7 is supposed to have greatly improved HDPI support, check it out:

Jaex commented 7 years ago

.NET 4.7 only works in Windows 10 creative update according to here: https://msdn.microsoft.com/en-us/library/bb822049(v=vs.110).aspx

adalinesimonian commented 6 years ago

@Jaex .NET Framework 4.7 is now available for Windows 7 SP1 and up.

https://blogs.msdn.microsoft.com/dotnet/2017/05/02/announcing-the-net-framework-4-7-general-availability/

roman-ku commented 6 years ago

Just looks a little funny...

Drawing
ghost commented 6 years ago

.NET 4.7 only works in Windows 10 creative update according to here: https://msdn.microsoft.com/en-us/library/bb822049(v=vs.110).aspx

Nope. Works on Windows 7 SP1, 8.1, 10.0.14393, 10.0.15063 and 10.0.16299.

The HiDPI support specifically would only be enabled on 10.0.15063 or newer (effectively 7 and 8.1 and 10.0.14393 won't benefit) but this is fine considering 10.0.14393 won't be supported by Microsoft as of March 2018.

So I'd recommend implementing it and using the Build 15063 SDK to package it for the Windows Store if this is implemented.

Jaex commented 6 years ago

I added DpiAwareness to app manifest: https://github.com/ShareX/ShareX/blob/master/ShareX/app.manifest#L6 I wonder if people have .NET Framework 4.7.1 installed in their system, is this config will be used for HDPI support because .NET 4.7.1 is in-place update for .NET 4.6.2 (which is what latest ShareX version gonna use). Another reason I'm suspecting this because when we are using .NET 4.0 which not supports TLS 1.2, if people had .NET 4.5 or higher is installed then ShareX could use TLS 1.2. If you would like to try it, because I don't have high dpi monitor for testing. You can install dev build like this: https://getsharex.com/docs/dev-builds Be sure to have Windows 10 Fall Creators Update and .NET Framework 4.7.1 installed too.

ghost commented 6 years ago

I wonder if people have .NET Framework 4.7.1 installed in their system, is this config will be used for HDPI support because .NET 4.7.1 is in-place update for .NET 4.6.2 (which is what latest ShareX version gonna use).

Windows 10 Users receive .NET Framework 4.7.1 as an automatic update if it's not installed. The only potential issue is Windows 7 users and Windows 8.1 users not having it in on their system.

And the solution to that would be just to let Windows 7 and Windows 8.1 users know that they need to download and install .NET 4.7.1 if it isn't already installed.

You can install dev build like this: https://getsharex.com/docs/dev-builds Be sure to have Windows 10 Fall Creators Update and .NET Framework 4.7.1 installed too.

Have you pushed an update to the dev channel? Cos I checked the checkbox for dev builds and nothing happened.

Jaex commented 6 years ago

Yes all commits generate new setup file.

Jaex commented 6 years ago

See this is why upgrading to .NET 4.7 is not gonna worth, I couldn't even find single person to test DpiAwareness stuffs.

ghost commented 6 years ago

See this is why upgrading to .NET 4.7 is not gonna worth, I couldn't even find single person to test DpiAwareness stuffs.

A lot of people don't know about the ShareX Github or don't use the Beta. I'd recommend changing the beta checkbox not to require a middle click since many HiDPI devices are laptops.

ghost commented 6 years ago

@Jaex I don't think your HiDPI thing worked cos this is on 2736x1824 at 200% scaling.

sharex

Jaex commented 6 years ago

It looks pretty big, how so it not works?

ghost commented 6 years ago

The controls are still fairly small and it isn't ideal. To me it looks like a regular app which isn't optimized.

Maybe offer a UI scale slider in app settings to increase the size of things?

dasjestyr commented 6 years ago

@AluminiumTech They look proportional and similar to how they do on a 2k monitor, don't they? I believe the effort was to fix the scaling, not optimize it for 4k, right?

ghost commented 6 years ago

@dasjestyr That wasn't 4K. It was 3:2 2K . The size of the UI components is wayyy too small in general in my opinion. Hence, the UI Scale slider suggestion.

dasjestyr commented 6 years ago

@AluminiumTech I don't disagree, however inflating those elements will undoubtedly have other unintended UX side effects in the same way vein as them being too small. It sounds more like you're asking for a UI/UX overhaul, which would be a separate issue.

ghost commented 6 years ago

@dasjestyr Actually, with the way the .NET 4.7 HiDPI changes work, there shouldn't be too many issues (if any at all) by increasing the size of the controls.

dasjestyr commented 6 years ago

@AluminiumTech perhaps. Still sounds like a different issue then :) dev's choice!

dasjestyr commented 6 years ago

Heeyyyyyy fun news: .Net core 3 is bringing WinForms into the mix and seems to have a lot of threads to pull on to modernize this application without too much effort. 💯

trzecieu commented 5 years ago

With 2 screens: one HiDPI (4k on 15") and second FullHD+ on 17" it looks even funnier. This is kind of common problem across several different applications. Unfortunately HiDPI Compatibility mode (System (Enhanced)) makes ShareX unusable.

NicoHaase commented 5 years ago

Any news on this? I've just bought a new display and experience the same problem: the 4K display obeys the 1.5x scaling (and displays ShareX in proper size), the secondary FullHD display shows ShareX way too large

woble commented 5 years ago

Unsure if related, but I'm experiencing somewhat odd issue related to DPI.

Windows 10 build 1903. Connected to a 4k TV with 250% scale in display settings. Invoking print screen through ShareX zooms the whole screen to what appears to be 250%. Basically can't see a big portion of the screen at that point. Moving the mouse over does appear to highlight regions of open windows. Upon selecting a region/window to take screenshot of, the screenshot is taken from the zoomed in view.

ceefour commented 4 years ago

I have both a 4K laptop and a 4K TV.

In ShareX 13.0.1, it seems this problem is much better now than what has been discussed in the past.

Currently, for all 4K screens, ShareX looks just fine with proper scaling.

However, when I have 4K screen as primary and 1080p screen as secondary, ShareX will still display scaled up on the secondary 1080p screen (i.e. really zoomed up). I think the reverse would be true (if 1080p is the primary, ShareX would look really small in the 4K screen). Winforms should have a way to configure the app so that it scales properly in all screens (and there should be no manual coding/scaling involved, but need to be configured correctly), but I'm not familiar with it.

A much more serious issue is #4038, because it prevents from taking proper screenshots. And #4242.

hostmit commented 4 years ago

Confirming dual monitor (4K + 2K) issue. Wont scale.

PerryCodes commented 3 years ago

I find it hard to believe that these DPI issues "cannot be fixed" and they make working with software like Greenshot and ShareX a HORRIBLE experience on 4K laptops with normal external monitors.