Merged in bitmap rotation code.