get Pixel from TypedValue - Android Graphics

Android examples for Graphics:Pixel

Description

get Pixel from TypedValue

Demo Code


//package com.java2s;

import android.content.Context;

import android.util.TypedValue;

public class Main {
    public static float getPX(Context context, int dipValue) {
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 30,
                context.getResources().getDisplayMetrics());
    }//from  ww w  .ja v a 2s  .  c om
}

Related Tutorials