public static class Utils { public static int DpToPixel(int dp) { return (int)(dp * Resources.System.DisplayMetrics.Density + 0.5f); } }