Code example for Bitmap

Methods: getConfiggetDensitygetHeightgetRowBytesgetWidth

0
 
public class BitmapUtil { 
	 
	public static final String toString(Bitmap bm){
		StringBuffer sb = new StringBuffer();
		sb.append(" config=" + bm.getConfig());
		sb.append(" width=" + bm.getWidth());
		sb.append(" height=" + bm.getHeight());
		sb.append(" density=" + bm.getDensity());
		sb.append(" rowBytes=" + bm.getRowBytes());
		return sb.toString();
	} 
	 
	 
	/** 
	 * 将Drawable转化为Bitmap 
	 */ 
	public static final Bitmap decode(Drawable drawable) {
		int width = drawable.getIntrinsicWidth();
		int height = drawable.getIntrinsicHeight();
Contextual code suggestions in your IDE  Get Codota for Java