Code example for BitmapFactory.Options

Methods: decodeByteArray

0
			} 
		} 
	} 
	public static Bitmap getBitmap(byte[] bytes,int w,int h){
		Bitmap bitmap = null;
		Options opts = new Options();
		opts.inJustDecodeBounds = true;
		bitmap = BitmapFactory.decodeByteArray(bytes,0,bytes.length,opts);
		int xScale = opts.outWidth / w;
		int yScale = opts.outHeight / h;
		opts.inSampleSize = xScale>yScale?xScale:yScale;
		opts.inJustDecodeBounds = false;
		bitmap = BitmapFactory.decodeByteArray(bytes,0,bytes.length,opts);
		return bitmap;
	} 
	 
	/** 
	 * »ñÈ¡´øµ¹Ó°µÄbitmap 
	 * @param originalImage 
	 * @return 
Stop searching for code, let great code find you!  Add Codota to your java IDE