Thursday, December 1, 2011

How to convert Pixel into DIP


private int getDip(int pixelValue){
Resources r = getResources();
int px = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, pixelValue, 
                r.getDisplayMetrics());
return px;
}

No comments:

Post a Comment