Eclipse 界面图标在 Windows 8.1 的高分辨率屏幕上非常小

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20718093/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 21:59:51  来源:igfitidea点击:

Eclipse interface icons very small on high resolution screen in Windows 8.1

eclipsewindows-8.1

提问by SeeJay719

The various icons and buttons in the Eclipse (Kepler) interface are very, very small on a laptop with a 3200x1800px screen. The red error decoration that appears to indicate errors on files is difficult to see unless my nose a few cm from the screen.

Eclipse (Kepler) 界面中的各种图标和按钮在具有 3200x1800px 屏幕的笔记本电脑上非常非常小。除非我的鼻子离屏幕几厘米,否则很难看到似乎表明文件错误的红色错误装饰。

I've played around with adjusting the screen resolution and other settings in the operating system (Windows 8.1), which helps, but results in other applications appearing too large, and even then the Eclipse icons are uncomfortably small. Enlarging the fonts in the Eclipse preferences (window>preferences>Dialog Font) doesn't affect the icon size.

我尝试过在操作系统 (Windows 8.1) 中调整屏幕分辨率和其他设置,这有帮助,但导致其他应用程序显得太大,即使这样,Eclipse 图标也小得令人不舒服。在 Eclipse 首选项(窗口>首选项>对话框字体)中放大字体不会影响图标大小。

Is there any easy way to force larger icons? Any work arounds (I've used the Magnifier but that's a rather clunky solution)? Should I just buy a magnifying glass and keep it next to my mouse? Maybe someone should make a mouse with a magnifying glass embedded? :)

有什么简单的方法可以强制使用更大的图标吗?任何解决方法(我使用过放大镜,但这是一个相当笨重的解决方案)?我应该买一个放大镜放在我的鼠标旁边吗?也许有人应该制作一个嵌入放大镜的鼠标?:)

Thanks.

谢谢。

采纳答案by Jae

I have looked up solutions for this issue for the last month, but I have not found an ideal solution yet. It seems there should be a way around it, but I just can't find it.

上个月我一直在寻找这个问题的解决方案,但我还没有找到理想的解决方案。似乎应该有办法解决它,但我就是找不到。

I use a laptop with a 2560x1600 screen with the 200% magnification setting in Windows 8.1 (which makes it looking like a 1280x800 screen but clearer).

我在 Windows 8.1 中使用了 2560x1600 屏幕和 200% 放大率设置的笔记本电脑(这使它看起来像 1280x800 屏幕但更清晰)。

Applications that support such "HiDPI" mode look just gorgeous, but the ones that don't (e.g. Eclipse) show tiny icons that are almost unreadable.

支持这种“HiDPI”模式的应用程序看起来很漂亮,但不支持的应用程序(例如 Eclipse)显示几乎无法阅读的小图标。

I also use an outdated version of Visual Studio. That has not been updated for HiDPI (obviously MS wants me to use a newer version of VS), but it still works kind of ok with HiDPI screens since it just scales things up twice -- the sizes of icons and letters are normal but they look lower-resolution.

我还使用过时的 Visual Studio 版本。这还没有针对 HiDPI 进行更新(显然 MS 希望我使用较新版本的 VS),但它在 HiDPI 屏幕上仍然可以正常工作,因为它只是放大了两倍——图标和字母的大小是正常的,但它们看起来分辨率较低。

After I saw how VS works, I began looking up a way to launch Eclipse in the same mode since it would not be technically very hard to just scale things up like how VS does. I thought there would be an option I could set to launch Eclipse in that mode. I couldn't find it though.

在我看到 VS 的工作原理后,我开始寻找一种以相同模式启动 Eclipse 的方法,因为从技术上讲,像 VS 那样进行扩展并不难。我认为我可以设置一个选项以在该模式下启动 Eclipse。不过我没找到。

After all, I ended up lowering the screen resolution to 1/4 (from 2560x1600 to 1280x800) with no magnification (from 200% to 100%) and not taking advantage of the high-resolution screen until Eclipse gets updated to support it since I had to do some work, but I am desparately waiting for an answer to this issue.

毕竟,我最终将屏幕分辨率降低到 1/4(从 2560x1600 到 1280x800),没有放大(从 200% 到 100%)并且没有利用高分辨率屏幕,直到 Eclipse 更新以支持它,因为我不得不做一些工作,但我正在绝望地等待这个问题的答案。

回答by Devin C

I struggled with this issue for a little bit too. I noticed a lot of you posted really complicated resolutions but there is a much easier way to do this! Its just a program and you shouldn't have to modify scripts, or install third party tools. The issue is related to High DPI scaling as mentioned above but what I think a lot of you are missing is that you can't directly modify compatibility settings on the launcher itself. The launcher and eclipse are two different programs! You need to browse to the Eclipse.exe and override the High DPI scaling option there. Once set, you can use the launcher as normal. The launcher will hit the executable, launch the eclipse.exe and since you set the compatibility settings on the .exe it will run using those settings. I spent like 10 minutes tracking down where the exe was so if its any help mine was located in: C:\Users\username\AppData\Local\Yatta\Launcher\installations\eclipse-ide-for-java-developers\eclipse.exe

我也在这个问题上挣扎了一点。我注意到你们很多人发布了非常复杂的决议,但有一个更简单的方法来做到这一点!它只是一个程序,您不必修改脚本或安装第三方工具。这个问题与上面提到的高 DPI 缩放有关,但我认为你们很多人都缺少的是你不能直接修改启动器本身的兼容性设置。启动器和日食是两个不同的程序!您需要浏览到 Eclipse.exe 并覆盖那里的高 DPI 缩放选项。设置后,您可以正常使用启动器。启动器将点击可执行文件,启动 eclipse.exe 并且由于您在 .exe 上设置了兼容性设置,它将使用这些设置运行。

Here is a screen shot of how I set my compatibility settings.

这是我如何设置兼容性设置的屏幕截图。

Eclipse.exe compatibility settings

Eclipse.exe 兼容性设置

And yes, the icons were super small before adjusting this setting. I tried setting compatibility settings on the launcher itself but it obviously didn't fix the issue. But after setting the override High DPI setting for the eclipse.exe icons are now normal size. Let me know if this works for others!

是的,在调整此设置之前,图标非常小。我尝试在启动器本身上设置兼容性设置,但显然没有解决问题。但是在为 eclipse.exe 图标设置覆盖高 DPI 设置后,现在是正常大小。让我知道这对其他人是否有效!

回答by David Levy

I figured that one solution would be to run a batch operation on the Eclipse JAR's which contain the icons and double their size. After a bit of tinkering, it worked. Results are pretty good - there's still a few "stubborn" icons which are tiny but most look good.

我认为一种解决方案是在 Eclipse JAR 上运行批处理操作,其中包含图标并将其大小加倍。经过一番修修补补,它奏效了。结果相当不错 - 仍然有一些“顽固”的图标很小,但大多数看起来都不错。

Eclipse After Processing on QHD

在 QHD 上处理后的 Eclipse

I put together the code into a small project: https://github.com/davidglevy/eclipse-icon-enlarger

我把代码整理成一个小项目:https: //github.com/davidglevy/eclipse-icon-enlarger

The project works by:

该项目由:

  1. Iterating over every file in the eclipse base directory (specified in argument line)
  2. If a file is a directory, create a new directory under the present one in the output folder (specified in the argument line)
  3. If a file is a PNG or GIF, double
  4. If a file is another type copy
  5. If a file is a JAR or ZIP, create a target file and process the contents using a similar process: a. Images are doubled b. Other files are copied across into the ZipOutputStream as is.
  1. 迭代 eclipse 基目录中的每个文件(在参数行中指定)
  2. 如果文件是目录,则在输出文件夹中的当前目录下创建一个新目录(在参数行中指定)
  3. 如果文件是 PNG 或 GIF,请加倍
  4. 如果文件是另一种类型的副本
  5. 如果文件是 JAR 或 ZIP,请创建目标文件并使用类似的过程处理内容:图像加倍 B. 其他文件按原样复制到 ZipOutputStream 中。

The only problem I've found with this solution is that it really only works once - if you need to download plugins then do so in the original location and re-apply the icon increase batch process.

我发现此解决方案的唯一问题是它实际上只能工作一次 - 如果您需要下载插件,请在原始位置下载并重新应用图标增加批处理。

On the Dell XPS it takes about 5 minutes to run.

在戴尔 XPS 上运行大约需要 5 分钟。

Happy for suggestions/improvements but this is really just an adhoc solution while we wait for the Eclipse team to get a fix out.

很高兴提出建议/改进,但这实际上只是我们等待 Eclipse 团队修复的临时解决方案。

回答by Michael Medin

For completion I thought I'd add that this issue is solved in Eclipse 4.6 Neon https://www.eclipse.org/downloads/index-developer.php(the current developer version). The icons look a bit sad (low resolution) but at least they are scaled correctly on my 4k screen.

为了完成,我想我会补充说这个问题在 Eclipse 4.6 Neon https://www.eclipse.org/downloads/index-developer.php(当前的开发者版本)中得到了解决。图标看起来有点悲伤(低分辨率),但至少它们在我的 4k 屏幕上正确缩放。

回答by Vergil C.

Had same problem, to resolve it, create a shortcut of the launcher, right click > properties > compatibility > tick on 'Override high DPI scaling behaviour' and select System Enhanced from the dropdown as shown on pic below. Relaunch eclipse after changes.

有同样的问题,要解决它,创建启动器的快捷方式,右键单击 > 属性 > 兼容性 > 勾选“覆盖高 DPI 缩放行为”,然后从下拉列表中选择系统增强,如下图所示。更改后重新启动 eclipse。

enter image description here

在此处输入图片说明

回答by Jamie Carl

I'm running on a Dell XPS 15. Rather than stuffing around with resolutions and magnifications and all that, I just did the following:

我在戴尔 XPS 15 上运行。 而不是解决分辨率和放大率之类的问题,我只是做了以下事情:

  • Right click the launcher icon
  • Click on "properties"
  • Select the "compatibility" tab
  • Choose "Windows XP (Service Pack 3)" for "Run this program in compatibility mode for:".
  • 右键单击启动器图标
  • 点击“属性”
  • 选择“兼容性”选项卡
  • 选择“Windows XP (Service Pack 3)”作为“以兼容模式运行此程序:”。

Everything seems to work fine and the display looks good (if a bit blurry/pixelly). The only difference i can see is that the title bar is in Windows XP style (oh no!!!).

一切似乎都工作正常,显示效果很好(如果有点模糊/像素)。我能看到的唯一区别是标题栏是 Windows XP 风格的(哦,不!!!)。

I'm curious to know if this works for others and if anyone comes across any problems.

我很想知道这对其他人是否有效,以及是否有人遇到任何问题。

回答by Brendan Annable

I found the easiest way was to create a manifest file which forces Windows to scale the application. It is blurry and non-ideal but better than an almost invisible UI! It seems this technique is applicable to any application too.

我发现最简单的方法是创建一个清单文件,强制 Windows 扩展应用程序。它模糊且不理想,但比几乎不可见的用户界面要好!似乎这种技术也适用于任何应用程序。

Create an eclipse.exe.manifestfile in the same folder as eclipse.exe and place the following XML within it:

在与 eclipse.exe 相同的文件夹中创建一个eclipse.exe.manifest文件,并将以下 XML 放入其中:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">

<dependency>
  <dependentAssembly>
    <assemblyIdentity
      type="win32"
      name="Microsoft.Windows.Common-Controls"
      version="6.0.0.0" processorArchitecture="*"
      publicKeyToken="6595b64144ccf1df"
      language="*">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

<dependency>
  <dependentAssembly>
    <assemblyIdentity
      type="win32"
      name="Microsoft.VC90.CRT"
      version="9.0.21022.8"
      processorArchitecture="amd64"
      publicKeyToken="1fc8b3b9a1e18e3b">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
  <security>
    <requestedPrivileges>
      <requestedExecutionLevel
        level="asInvoker"
        uiAccess="false"/>
    </requestedPrivileges>
  </security>
</trustInfo>

<asmv3:application>
  <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
    <ms_windowsSettings:dpiAware xmlns:ms_windowsSettings="http://schemas.microsoft.com/SMI/2005/WindowsSettings">false</ms_windowsSettings:dpiAware>
  </asmv3:windowsSettings>
</asmv3:application>

</assembly>

回答by Yucelen Gul

The best way is to edit the exe manifest with something like resource tuner and add

最好的方法是使用资源调谐器之类的东西编辑 exe 清单并添加

    <application xmlns="urn:schemas-microsoft-com:asm.v3"><windowsSettings><ms_windowsSettings:dpiAware xmlns:ms_windowsSettings="http://schemas.microsoft.com/SMI/2005/WindowsSettings" xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">false</ms_windowsSettings:dpiAware></windowsSettings></application>        

after dependency to set the exe as dpi unaware. This way the program will be a little pixelated but it will be in a confortable size.

依赖后将 exe 设置为 dpi 不知道。这样程序会有点像素化,但它的大小会很舒服。

回答by Shirish Coolkarni

Best effortless solution is to go for Eclipse Neon. All bugs are fixed as a part of this release. https://bugs.eclipse.org/bugs/show_bug.cgi?id=421383

最好的轻松解决方案是使用 Eclipse Neon。作为此版本的一部分,所有错误均已修复。https://bugs.eclipse.org/bugs/show_bug.cgi?id=421383

回答by flavio.donze

Have a look at Neon (4.6) M6 - New and Noteworthy, the milestone release contains some automatic scaling for images (e.g. for toolbar).

看看Neon (4.6) M6 - New and Noteworthy,里程碑版本包含一些图像的自动缩放(例如工具栏)。

SWT provides resolution-based auto-scaling

SWT 提供基于分辨率的自动缩放

SWT now automatically scales images on high-DPI monitors on Windows and Linux, similar to the Mac's Retina support on OS X. In the absence of high-resolution images, SWT will auto-scale the available images to ensure that SWT-based applications like Eclipse are scaled proportionately to the resolution of the monitor.

enter image description here

This feature can be disabled on Windows and GTK by setting this VM argument to false in eclipse.ini or on the command line after -vmargs:

-Dswt.enable.autoScale=false

Auto-scaling cannot be disabled on the Mac as it is provided by the OS.

Caveats: We're aware that some scaled images look bad at scale factors less than 200%. This will be improved in M7. Furthermore, we're working on support for high-DPI images in Platform UI, so that plug-in providers can add high-DPI icons without doing any code changes.

SWT 现在在 Windows 和 Linux 上的高 DPI 显示器上自动缩放图像,类似于 OS X 上 Mac 的 Retina 支持。在没有高分辨率图像的情况下,SWT 将自动缩放可用图像以确保基于 SWT 的应用程序Eclipse 与显示器的分辨率成正比。

在此处输入图片说明

通过在 eclipse.ini 中或在命令行中 -vmargs 之后将此 VM 参数设置为 false,可以在 Windows 和 GTK 上禁用此功能:

-Dswt.enable.autoScale=false

无法在 Mac 上禁用自动缩放,因为它是由操作系统提供的。

警告:我们知道一些缩放图像在比例因子小于 200% 时看起来很糟糕。这将在 M7 中得到改进。此外,我们正致力于在平台 UI 中支持高 DPI 图像,以便插件提供商可以在不进行任何代码更改的情况下添加高 DPI 图标。



Or maybe this helps, in Eclipse Mars API for high resolution was added



或者这可能有帮助,在 Eclipse Mars API 中添加了高分辨率

New APIs have been added to provide support for rendering high-resolution images on high-DPI monitors. Two constructors have been added to the Image class. They accept image-provider callbacks that allow clients to supply resolution-dependent versions of images:

public interface ImageDataProvider {
  public ImageData getImageData (int zoom);
}
public interface ImageFileNameProvider {
  public String getImagePath (int zoom);
}

Depending on the user's monitor configuration, SWT will request images with the corresponding zoom level. Here's an example that displays 3 original images, followed by variants whose resolution changes depending your monitor's resolution: Snippet367.java.

Note that this is just the first step to support high-resolution images in SWT and Eclipse-based applications. Work is underway to adopt the new APIs in the platform. Futhermore, more work in SWT is required to properly support drawing into high-resolution images via GC.

添加了新的 API 以支持在高 DPI 显示器上渲染高分辨率图像。Image 类中添加了两个构造函数。它们接受图像提供者回调,允许客户端提供依赖于分辨率的图像版本:

public interface ImageDataProvider {
  public ImageData getImageData (int zoom);
}
public interface ImageFileNameProvider {
  public String getImagePath (int zoom);
}

根据用户的监视器配置,SWT 将请求具有相应缩放级别的图像。这是一个显示 3 个原始图像的示例,后跟其分辨率根据显示器分辨率而变化的变体:Snippet367.j​​ava

请注意,这只是在 SWT 和基于 Eclipse 的应用程序中支持高分辨率图像的第一步。在平台中采用新 API 的工作正在进行中。此外,还需要在 SWT 中做更多工作才能正确支持通过 GC 绘制高分辨率图像。

APIs for high-DPI monitor support
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2FwhatsNew%2Fplatform_isv_whatsnew.html

支持高 DPI 监视器的 API
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2FwhatsNew%2Fplatform_isv_whatsnew.html