Matrix matrix = new Matrix();
newHeight = getHeight() - canon1[0].getHeight() - stand1.getHeight();
Log.d(TAG, "New Height : " + newHeight);
matrix.setTranslate(-newHeight,newHeight);
matrix.postRotate(-30,0,0);
canvas.drawBitmap(canon1[0], matrix, null);
This code, which I wrote from the link to the code above, works absolutely fine.
.