问题
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.
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.
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.
回答1:
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).
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.
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.
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.
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.
回答2:
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.
I put together the code into a small project: https://github.com/davidglevy/eclipse-icon-enlarger
The project works by:
- Iterating over every file in the eclipse base directory (specified in argument line)
- If a file is a directory, create a new directory under the present one in the output folder (specified in the argument line)
- If a file is a PNG or GIF, double
- If a file is another type copy
- 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.
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.
Happy for suggestions/improvements but this is really just an adhoc solution while we wait for the Eclipse team to get a fix out.
回答3:
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
Here is a screen shot of how I set my compatibility settings.
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!
回答4:
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.
回答5:
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.
回答6:
I'm running on a Dell XPS 15. Rather than stuffing around with resolutions and magnifications and all that, I just did the following:
- 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:".
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!!!).
I'm curious to know if this works for others and if anyone comes across any problems.
回答7:
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.
Create an eclipse.exe.manifest file in the same folder as eclipse.exe and place the following XML within it:
<?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>
回答8:
The best way is to edit the exe manifest with something like resource tuner and add
<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.
回答9:
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
回答10:
-SurfacePro3-
- Download and unzip eclipse "32bit Version".
- Run on "Windows XP mode".
回答11:
The compatibility mode for Windows Xp, it's only available for the Eclipse 32 bit version and after running in this compatibility mode the icons and text will be the right size, but blurry because they are scaled from their native resolution to the screen resolution and doing so the quality is lost.
回答12:
I fixed @Sigh's solution by creating a (Linux) shellscript (.sh
) to do something similar. This is very crude, brutal, and requires adoption for your specific system. Use at your own risk. It might break your entire installation. Make backups of the folders before you run this script. Script can be improved.
#!/bin/bash
for J in *.jar
do
echo "Copying $J..."
mkdir -p "/tmp/$J"
cp "$J" "/tmp/$J/"
cd "/tmp/$J"
echo "Extracting $J..."
jar xf "$J"
rm "$J"
echo "Processing images..."
find . -name "*.gif" -exec convert {} -resize 200% {} \;
echo "Compressing $J..."
if [ `ls .[^.]* 2>/dev/null | wc -l` = 0 ]
then
jar cf "$J" *
else
jar cf "$J" * .[!.]*
fi
cd -
mv $J{,-bak}
mv "/tmp/$J/$J" .
rm -rf "/tmp/$J"
echo "Done."
echo ""
done
Run this in /opt/eclipse/plugins
and ~/.eclipse/org.eclipse.platform_4.x.x/plugins
(or whatever the paths for your installation are). Same issues as with @Sigh's solution: This is a brutal "fix" and breaks after every update or new installation.
Script can be perfected:
- Ignore .jar files without /icons/ folder
- Only resize images that are 16x16 so you can run this again after every update/installation
Requires imagemagick
.
Caveats
- It doesn't work on all icons.
- Does anyone know where the other assets are or why they aren't resized? Perhaps they are not
.gif
?
- Does anyone know where the other assets are or why they aren't resized? Perhaps they are not
- Project Explorer icons are messed up.
Fixes are welcome!
回答13:
Have a look at Neon (4.6) M6 - New and Noteworthy, the milestone release contains some automatic scaling for images (e.g. for toolbar).
SWT provides resolution-based auto-scaling
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.
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.
Or maybe this helps, in Eclipse Mars API for high resolution was added
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.
APIs for high-DPI monitor support
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2FwhatsNew%2Fplatform_isv_whatsnew.html
回答14:
Following solution worked for me
First you need to add this registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\PreferExternalManifest (DWORD) to 1
Next, a manifest file with the same name as the executable must be present in the same folder as the executable. The file is named eclipse.exe.manifest and consists of:
<?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">
<description>eclipse</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3"
level="asInvoker"
ms_asmv3:uiAccess="false">
</requestedExecutionLevel>
</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>
you can find more details here
回答15:
Thank you Sigh David Levy. I could not develop on Eclipse w/out your sol'n. I had to add a coupla catch (exceptions) to your code to get it to work:
while (srcEntries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) srcEntries.nextElement();
logger.info("Processing zip entry ["+ entry.getName() + "]");
ZipEntry newEntry = new ZipEntry(entry.getName());
try { outStream.putNextEntry(newEntry); }
***catch (Exception e) {
logger.error("error: ", e);
outStream.closeEntry();
continue;*
}**
回答16:
There is a nice article in JaxEnter for an work around HiDPI for Eclipse
回答17:
What worked for me at the end was adding the manifest file to the javaw.exe just like Heikki Juntunen said at https://bugs.eclipse.org/bugs/show_bug.cgi?id=421383#c66
The instructions about how to edit the registry and create the manifest file where written by Matthew Cochrane at https://bugs.eclipse.org/bugs/show_bug.cgi?id=421383#c60 and @KItis wrote the instructions here
I put here a copy of that post:
First you need to add this registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\PreferExternalManifest (DWORD) to 1
Next, a manifest file with the same name as the executable must be present in the same folder as the executable. The file is named eclipse.exe.manifest and consists of:
<?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">
<description>eclipse</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3"
level="asInvoker"
ms_asmv3:uiAccess="false">
</requestedExecutionLevel>
</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>
回答18:
The below change works seamlessly.
Quoting from CrazyPenguin's reply
"For those, like me, who found that even on the new Eclipse it wasn't scaled, see here: swt-autoscale-tweaks Basically I added -Dswt.autoScale=quarter to my eclipse.ini file."
回答19:
Here is my solution Inspired by @Sigh's solution (this one doesn't use maven):
https://github.com/gitAmrit/EclipseIconEnlarger/tree/master#eclipseiconenlarger
This works by searching for all images smaller or equal to 16x16px and scaling them up by whatever factor the user wants.
running the utility: java images.EclipseIconEnlarger eclipseBasePath magnificaitonfactor
eg: java images.EclipseIconEnlarger C:\Users\Amrit\Codes\eclipse 2
eclipseBasePath = path where eclipse.exe is located, for e.g. C:\Users\Amrit\Codes\eclipse magnificationfactor = factor by which the image should be enlarged, for e.g. 2 = double
回答20:
Here's another command line solution, but this works for Windows.
It requires winrar installed (edit the set winrar line to point to the winrar installation).
It also requires imagemagick to be installed and its path to be added in your commandline.
One last comment is I recommend running this before opening Eclipse for the first time (ie, fresh install). There are icons that get automatically unpacked from jars and saved in eclipse/configuration/org.eclips.osgi/... (potentially among other folders) and editing the .jar file prevents the icon from being resized. You might be able to delete this folder and it might autoextract again, but I can't confirm.
To run, just create a doubler.bat file in your eclipse/plugins directory and it should resize any icon smaller than 32x32 to that proportioned size.
Here's the code:
@echo off
set winrar="C:\Program Files\WinRAR\winrar.exe"
set startpath=%~dp0
::All *.jar in this folder
FOR %%G in (*.jar) do (call :EachJar "%%G")
GOTO :eof
:EachJar
::echo %1
set nameWOQuotes=%~1
mkdir "tmp\%nameWOQuotes%"
::copy "%nameWOQuotes%" "tmp\%nameWOQuotes%.bak" >NUL
%winrar% x -inul "%nameWOQuotes%" *.jpg *.gif *.png *.tif *.tiff "tmp\%nameWOQuotes%\"
::pause
cd "tmp\%nameWOQuotes%"
FOR /R .\ %%H in (*.jpg *.gif *.png *.tif *.tiff) do (
::echo %nameWOQuotes%-%%~nxH >> "%startpath%\output.txt"
identify "%%H" >> "%startpath%\output.txt"
convert "%%H" -resize 32x32^< "%%H" )
%winrar% a -r -u "%startpath%\%nameWOQuotes%" "*"
cd "%startpath%"
rmdir /s /q "tmp\%nameWOQuotes%"
Goto :eof
It creates a file output.txt and inserts all the ORIGINAL images metadata before it is converted, regardless of whether or not it changed size.
回答21:
If you do not want to install a newer version of eclipse
As mentioned here,
in the eclipse.init file add -Dswt.autoScale=exact
after the -vmargs
and you are good to go.
Here exact
scales the icons to the native zoom.
But you will have to adjust with the blurred and jagged icons.
回答22:
I had this problem when I changed my default Windows 10 language from Eng to Italian, with Eclipse being installed when default language was Eng. Reverting Windows language to Eng and rebooting solved the problem. I don’t know what’s happened, Windows rename some folders like C:\Users translating it in your default language (i.e. C:\Utenti) and maybe this is causing problems.
回答23:
Jae's above solution worked for me. The manifest solution didn't work for me. Thanks Jae.
Setup:On my windows 8.1 64 bit non tablet laptop I downloaded eclipse 64 bit with jdk 64 bit.
- Right mouse click on desktop to access screen resolution and lowered the screen resolution display from 3000 level to 2048 x 1152.
- Click on make text and other items larger or smaller link and changed it to large 150% instead of extra extra large - 250%.
- Logged out and Logged back in.
- Restart Eclipse and the icons are now visible even if it is a bit smaller, but much more legible now.
来源:https://stackoverflow.com/questions/20718093/eclipse-interface-icons-very-small-on-high-resolution-screen-in-windows-8-1