From: "Alan Wills" Newsgroups: comp.os.msdos.djgpp Subject: Flipping an image Date: Tue, 13 Jul 1999 10:59:58 +0100 Organization: University of Strathclyde Computer Centre Message-ID: <7mf2qk$nlg$1@rockall.cc.strath.ac.uk> NNTP-Posting-Host: dolphin.eee.strath.ac.uk X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Lines: 28 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com This seemed like a simple problem but I can't get it to work. How do I write a function that will flip an image about its horizontal axis. The image is stored in a 1-D array so the the function should look something like: void flip_image(int array[], int rows, int cols) { int row_count, col_count, total_pixelsp; for(row_count = 0; row_count < rows; row_count++) { for(col_count = 0; col_count < cols; col_count++) { array[???] = array[???]; } } } If anyone could fill in the blanks I'd be very grateful. Thanks, -- Alan ____________________________________ Alan Wills alan AT spd DOT eee DOT strath DOT ac DOT uk