Friday, 15 February 2013

Convert Pixel To Density Pixel

How to convert pixel in desity pixel

in android we need to pass "dp" as parameter of width and height at design time right?at run time we want to pass value but that will be pass as a "pixel" so that we want to convert that pixel in to density pixel and here is the code to convert pixel in to density pixel.