Code example for Matrix

Methods: postConcatpostScalepostTranslatereset

		float viewHeight = getHeight();
		float w = bitmap.getWidth();
		float h = bitmap.getHeight();
		// int rotation = bitmap.getRotation(); 
		// We limit up-scaling to 2x otherwise the result may look bad if it's 
		// a small icon. 
		float widthScale = Math.min(viewWidth / w, 2.0f);
		float heightScale = Math.min(viewHeight / h, 2.0f);
		float scale = Math.min(widthScale, heightScale);
		matrix.postScale(scale, scale);
		matrix.postTranslate((viewWidth - w * scale) / 2F, (viewHeight - h
				* scale) / 2F);
	// Combine the base matrix and the supp matrix to make the final matrix. 
	protected Matrix getImageViewMatrix() {
Connect your IDE to all the code out there  Get Codota for Java