Code example for Matrix

Methods: createBitmap, postScale

0
		int height = bm.getHeight();
		float scaleWidth = ((float) newWidth) / width;
		float scaleHeight = ((float) newHeight) / height;
 
		// create a matrix for the manipulation 
		Matrix matrix = new Matrix();
		// resize the bit map 
		matrix.postScale(scaleWidth, scaleHeight);
 
		// recreate the new Bitmap 
		Bitmap resizedBitmap = Bitmap.createBitmap(bm, 0, 0, width, height, matrix, false);
		return resizedBitmap;
	} 
 
	protected Bitmap getAppIcon(JSONObject app) {
		Bitmap img = BitmapFactory.decodeResource(mact.getResources(), R.drawable.soup);
		try { 
			JSONObject icons = app.getJSONObject("icons");
			switch (icons.length()) {
			case 0: 
				break;