2

JavaFX is not blurry anymore in a retina macbook, according to this: How to make JavaFX Applications non-blurry on Retina Display

But if you use an image (like, put an image in a button), the image will be blurry. This is natural because obviously the image is being scaled up.

How can I support retina images in a JavaFX application? That is, display non-blurry images in my buttons?

I imagine one would need two versions of the same image. One that is bigger than the other to be used if the application is run in a retina macbook, and the other to be used if the application is run in a standard display. But how?

Community
  • 1
  • 1
Saturn
  • 17,888
  • 49
  • 145
  • 271
  • I'm not much into GUI, but can't you use a resource loader which returns a specific version of the resource depending on the screen resolution, something like `Image image = ImageLoader.getImage(ImageId);` ? PS: You'll have to take care of multi monitor setups, which might have different resolutions. – Svetlin Zarev Jan 27 '15 at 20:14
  • Related question: [JavaFX 8 HiDPI Support](http://stackoverflow.com/questions/26182460/javafx-8-hidpi-support). – jewelsea Jan 27 '15 at 21:28
  • 1
    @SvetlinZarev: my problem is not about deciding what image to use. I can do that alright, but I don't know how to *apply* such image so that the retina effect kicks in (100x100 pixels taking the space of 50x50) – Saturn Jan 28 '15 at 05:37

0 Answers0