Hi-DPI Eclipse screenshots


A picture is worth a thousand words.

Recently I was writing a paper based on EMF-IncQuery, and I wanted to include some screenshots. For good reasons, a 300 dpi photo was recommended, but that represents quite large resolutions for reasonably sized images. Although I couldn’t always get this resolution, but I found some nice tricks to use for later.

Eclipse always allowed configuring some fonts – some time ago I experimented with the theming capabilities of Eclipse 3.x, and could increase a few font sizes, but some widgets such as list or tree viewers did not support such theming.1

GMF-based editors, such as the Papyrus UML editor or the Ecore Diagram editor provide support for exporting the diagram in PDF format – a format that retains (most2) graphical information of the diagram in a vector-graphic format, usable for inclusion in LaTeX documents.

The multitouch zooming support for Zest graphs also helped a lot for screenshots, as I could simply use all available screen area to get a nice shot. Even for graphs that do not contribute their Zoom Managers to the user interface.

Finally, OSX already supports Hi-DPI modes for its entire operating system (dubbed Retina Display), that can also be enabled on non-Retina displays with some hacking: basically by downloading the Quartz Debug program (details for Lion and Mountain Lion) I can reduce the visible resolution to 960×540 pixel on my Full HD monitor. It also supports the use of one monitor as HiDPI and the other as normal – that comes quite hand with applications that do not support HiDPI mode (such as Eclipse out of the box, or Firefox).

https://i1.wp.com/cubussapiens.hu/wp-content/uploads/2012/12/high-dpi-2.png?resize=380%2C300 380w, https://i0.wp.com/cubussapiens.hu/wp-content/uploads/2012/12/high-dpi-2.png?w=672 672w" sizes="(max-width: 300px) 85vw, 300px" /> OSX supports HiDPI modes

One big issue was that Eclipse 4.2 does not support HiDPI resolutions out of the box. Luckily, this was already evaluated in Bugzilla, and in a corresponding Stack Exchange entry.  Basically, the info.plist file3 of the Eclipse.app has to be updated to state it supports High DPI mode, and then the Application itself moved in order to OSX detect the changes.

As a result: Eclipse sees that it has a limited amount screen estate, while in practice it uses 4 times as many pixels. While it is not usable at all for everyday programming, it helped a lot for screenshot creation.4

https://i2.wp.com/cubussapiens.hu/wp-content/uploads/2012/12/uml-tree-editor.png?resize=150%2C150 150w" sizes="(max-width: 220px) 85vw, 220px" /> A low DPI version of a small screenshot
A HiDPI version of the same editor

Alltogether, there are various ways to create high definition screenshots in Eclipse. It helps knowing them and using accordingly. For this reason, I am curious what other ways are there to create screenshots with high resolution – how do you do it?

  1. Note to myself: I want to experiment with the 4.x theming capabilities, and update the presentation theme to work with the CSS-based themes of e4. []
  2. However, I did see some interesting glitches related to the background settings of Ecore Diagrams… []
  3. By the way, the XML syntax of the plist files is something awful – it reminds me of the parameter handling in shell scripts or console applications – odd numbered parameters are the keys while even ones are the values. Not that XML allows the definition of attributes or inlined elements – but who cares? []
  4. Except when using Skitch – a nice screenshot manager app. But it does not know about the underlying HiDPI mode, and always created a low DPI shot. []