I am creating a program where I have to rotate an image 90', 180' and 270'. The file being read in is an image file converted to numbers and these are read into an array.
The image is 60 ROWS by 60 COLS, the array being Picture2
To rotate the image 90' i am doing the following;
for (i=0; i<ROWS; i++)
for (j=0; j<COLS; j++)
Picture2[COLS-1-j][i]=Picture[i][j];
and to rotate the image 270' i am doing the following;
for (i=0; i<ROWS; i++)
for (j=0; j<COLS; j++) Picture2[j][ROWS-1-i]=Picture[i][j];
but I have no idea how to rotate it by 180' without doing the obvious of printing it out and turning the bit paper upside down!
Thanks for any help, it is EXTREMELY appreciated and if you need to look at the program then please email me and I will be happy to send you it ok!