public class DrawableProvider
extends java.lang.Object
Drawable 和 Bitmap 的工具类
Created by JessYan on 2015/11/24 Contact me Follow me ================================================
| Modifier and Type | Method and Description |
|---|---|
static int |
getBitmapDegree(java.lang.String path)
读取图片的旋转的角度
|
static android.graphics.Bitmap |
getReSizeBitmap(android.graphics.Bitmap bitmap,
float targetWidth,
float targetheight)
改变Bitmap的长宽
|
static android.graphics.drawable.Drawable |
getScaleDrawable(float percent,
android.graphics.drawable.Drawable drawable)
传入图片,将图片按传入比例缩放
|
static android.graphics.drawable.Drawable |
getScaleDrawable2(float width,
android.graphics.drawable.Drawable drawable)
传入图片,将图片按传入宽度和原始宽度的比例缩放
|
static android.graphics.drawable.Drawable |
getScaleDrawableForRadioButton(float percent,
android.widget.TextView tv)
将 TextView/RadioButton 中设置的 drawable 动态的缩放
|
static android.graphics.drawable.Drawable |
getScaleDrawableForRadioButton2(float width,
android.widget.TextView tv)
将 TextView/RadioButton 中设置的 drawable 动态的缩放
|
static android.graphics.drawable.Drawable |
getStateListDrawable(android.graphics.drawable.Drawable normalDrawable,
android.graphics.drawable.Drawable pressDrawable)
获得选择器
|
static android.graphics.Bitmap |
rotateBitmapByDegree(android.graphics.Bitmap bm,
int degree)
将图片按照某个角度进行旋转
|
static void |
setLeftDrawable(android.widget.TextView tv,
android.graphics.drawable.Drawable drawable)
设置左边的drawable
|
public static android.graphics.drawable.Drawable getStateListDrawable(android.graphics.drawable.Drawable normalDrawable,
android.graphics.drawable.Drawable pressDrawable)
normalDrawable - pressDrawable - public static android.graphics.drawable.Drawable getScaleDrawableForRadioButton(float percent,
android.widget.TextView tv)
percent - tv - public static android.graphics.drawable.Drawable getScaleDrawableForRadioButton2(float width,
android.widget.TextView tv)
tv - public static android.graphics.drawable.Drawable getScaleDrawable(float percent,
android.graphics.drawable.Drawable drawable)
percent - public static android.graphics.drawable.Drawable getScaleDrawable2(float width,
android.graphics.drawable.Drawable drawable)
width - public static void setLeftDrawable(android.widget.TextView tv,
android.graphics.drawable.Drawable drawable)
tv - drawable - public static android.graphics.Bitmap getReSizeBitmap(android.graphics.Bitmap bitmap,
float targetWidth,
float targetheight)
bitmap - public static android.graphics.Bitmap rotateBitmapByDegree(android.graphics.Bitmap bm,
int degree)
bm - 需要旋转的图片degree - 旋转角度public static int getBitmapDegree(java.lang.String path)
path - 图片绝对路径