Code example for Matrix

Methods: invert, mapPoints, set

0
	 * @param bitmap 要判断的图片 
	 * @param matrix 图片的Matrix对象 
	 * @return true 点中了图片 flase 没有点中图片 
	 */ 
	private boolean isContaintPointByBitmap(float x, float y, Bitmap bitmap, Matrix matrix) {
		Matrix tempMatrix = new Matrix();
		tempMatrix.set(matrix);
		tempMatrix.invert(tempMatrix);
		float[] xyPointArr = new float[2];
		tempMatrix.mapPoints(xyPointArr, new float[] { x, y });
 
		if (xyPointArr[0] > 0 && xyPointArr[0] < bitmap.getWidth() && xyPointArr[1] > 0
				&& xyPointArr[1] < bitmap.getHeight() / 2) {
			return true; 
		} else { 
			return false; 
		} 
	} 
}