public static int getPixelFromDp(Context context, int dp) {
		// Get the screen's density scale		
		float scale = context.getResources().getDisplayMetrics().density;

		// Convert the dps to pixels, based on density scale
		// because dp*scale is cast as an integer value, this will cause the result to be truncated.
		// Therefore, Adding ROUND_FACTOR helps the result to have properly rounded integer value.
		return (int)(dp * scale + ROUND_FACTOR);
	}
public static int getPixelFromDp ( Context context , int dp ) { float scale = context . getResources ( ) . getDisplayMetrics ( ) . density ; return ( int ) ( dp * scale + ROUND_FACTOR ) ; }
Converts DP to Pixel<br>

@param  dp DP
@return Pixel
@see <a href="http://developer.android.com/guide/practices/screens_support.html#dips-pels">http://developer.android.com/guide/practices/screens_support.html#dips-pels</a>