Skip to content

Commit

Permalink
update VonImageUtils
Browse files Browse the repository at this point in the history
update VonImageUtils
  • Loading branch information
秋逸 committed Oct 26, 2016
1 parent 890fc14 commit f97d16b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions VonTools/src/main/java/com/vondear/vontools/VonImageUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@

public class VonImageUtils {

/**
* dip转px
*
* @param context 上下文
* @param dpValue dp值
* @return px值
*/
public static int dip2px(Context context, float dpValue) {
return dp2px(context,dpValue);
}
/**
* dp转px
*
Expand All @@ -65,6 +75,17 @@ public static int dp2px(Context context, float dpValue) {
return (int) (dpValue * scale + 0.5f);
}

/**
* px转dip
*
* @param context 上下文
* @param pxValue px值
* @return dip值
*/
public static int px2dip(Context context, float pxValue) {
return px2dp(context, pxValue);
}

/**
* px转dp
*
Expand Down

0 comments on commit f97d16b

Please sign in to comment.