Retina / high resolution images

I have been trying to find a way to embed retina images with no success. I can´t find any component that does this and vaadin does not expose the browser window.devicePixelRatio property. Any ideas?

I can´t believe I am the only one who could use this…?

How about making an extension with js library of your choice that does that?
Currently a webinar runs that explained how to embed 3rd party js in Vaadin, seems reasonably simple.
https://vaadin.com/forum#!/thread/8508514

Yes I´ve done plenty of extentions already, just though that this should have been solved somehow already. But I´ll have another stab at it myself I guess.

Yeah, I see. I am not too experienced with Vaadin myself, so it is liekly that there could be something out there that does what you need. Maybe on github or something?

I just called Javascript to get window.devicePixelRatio like this:

JavaScript.getCurrent().addFunction(“setScreenRatio”, jsonArray →
screenRatio = ((Double)jsonArray.get(0).asNumber()).intValue()); Page.getCurrent().getJavaScript().execute(“setScreenRatio(window.devicePixelRatio || 1);”);

If anybody know better way, please say.