What should i do to convert ‘dp’ into ‘pixel’ by script?

What should i do to convert ‘dp’ into ‘pixel’ by script?

]]>

3 Commentsto What should i do to convert ‘dp’ into ‘pixel’ by script?

  1. Anonymous says:

    < ![CDATA[

    You need to use to multiply dpi with the “density” field found in the DisplayMetrics class.


    LL.getContext().getResources().getDisplayMetrics().density may work (not tested)

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Thanks!

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *