Android examples for Graphics:Pixel
convert Dip To Pixel
//package com.java2s; import android.content.Context; public class Main { public static int convertDipToPx(Context context, int dip) { float scale = context.getResources().getDisplayMetrics().density; return (int) (dip * scale + 0.5f * (dip >= 0 ? 1 : -1)); }//ww w . j av a2s . com }