How to properly scale images on hi-res screens

Our SWT-based Java application automatically uses the default font size for the operating system and displays other fonts. Consequently, GUI texts look great on hi-res screens (for example, 2880 x 1620 with Windows 8 configured as "Larger" in Control Panel> Appearance and Personalization> Display). Unfortunately, the images do not scale, so, for example, the toolbar buttons look too small.

In OS X, hi-res-screen processing seems simple: virtual resolution is half the size, but how to scale in Windows, which seems to allow non-integer scaling factors? How to determine when to scale and when not?

Update This SWT issue seems to cover a similar issue.

+4
source share
1 answer

Take a look at Neon (4.6) M6 - a new and noteworthy stage release that contains some automatic scaling for images (for example, a toolbar).

SWT provides resolution-based auto-scaling

SWT DPI Windows Linux, Mac Retina OS X. , SWT , SWT, Eclipse, .

enter image description here

Windows GTK, false eclipse.ini -vmargs:

-Dswt.enable.autoScale =

Mac, OS.

: , 200%. M7. , DPI , DPI - .



, , , Eclipse Mars API

API- . Image. - , :

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

SWT . , 3 , , : Snippet367.java.

, SWT Eclipse. API- . , SWT .

API DPI
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2FwhatsNew%2Fplatform_isv_whatsnew.html

+1

All Articles