How to calculate device pixel ratio

后端 未结 6 1463
独厮守ぢ
独厮守ぢ 2020-12-14 01:44

I would like to know how the -webkit-device-pixel-ratio is calculated. I had already read this. Yet I am unable to understand it clearly. I would also like to know if there

6条回答
  •  借酒劲吻你
    2020-12-14 02:29

    claculate display metrics and get

    DisplayMetrics dm = context.getResources().getDisplayMetrics(); int densityDpi = dm.densityDpi

    and use dm.xdpi, or dm.ydpi i.e pixcel desity

提交回复
热议问题