private static byte [ ] [ ] rotateArray ( byte [ ] [ ] bitarray ) { byte [ ] [ ] temp = new byte [ bitarray [ 0 ] . length ] [ bitarray . length ] ; for ( int ii = 0 ; ii < bitarray . length ; ii ++ ) { // This makes the direction consistent on screen when rotating the // screen; int inverseii = bitarray . length - ii - 1 ; for ( int jj = 0 ; jj < bitarray [ 0 ] . length ; jj ++ ) { temp [ jj ] [ inverseii ] = bitarray [ ii ] [ jj ] ; } } return temp ; }
Takes and rotates the it 90 degrees