• How to get PPI/DPI in browser?
    2 replies, posted
Hello, I just want to know if anyone here knows the best / most simplest way of getting PPI / DPI with Javascript? Thanks!
window.devicePixelRatio and multiply that by 96 You're not going to be able to get the real device resolution because browsers don't use that, everything in CSS is based around 96dpi (Windows at 100% UI scale on a 200dpi monitor would still show as 96dpi in a browser, but at 200% UI scale the browser would show 192dpi, etc.)
Ok what about pixel size (for example, don't Retinas have pixel size 0.5? (2 real pixels for one imaginary pixel))? Is it possible to know physical size of pixel? [editline]4th August 2014[/editline] nevermind, looks like this is what I need (window.devicePixelRatio). Thanks!
Sorry, you need to Log In to post a reply to this thread.