Here you can find the source of dip2px(float dipValue, float scale)
public static int dip2px(float dipValue, float scale)
//package com.java2s; public class Main { public static int dip2px(float dipValue, float scale) { return (int) (dipValue * scale + 0.5f); }// w w w . j a va 2 s.com }