Eddie, Thanks for the input. The original problem was where an incoming image stream was being copied into a new TIFF image within my application. Erwin had provided me with code that copied the incoming data pixel by pixel, including correctly changing the colour order as you have shown below. I had tried to copy the data scanline by scanline, but found the colour order to be different. Hence the reason why I had to resort back to pixel by pixel.
Thanks for the code example though. Kind regards, Darren -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eddie Shipman Sent: 20 April 2005 14:35 To: Borland's Delphi Discussion List Subject: RE: Working with bitmaps While not being involved in this whole discussion, I would think that by modifying this loop, you would be able to get BGR instead of RGB. I'm sure someone else can help out on reversing the byte order in the loop where shown. [code] for y := 0 to IMG_HEIGHT-1 do begin for x := 0 to IMG_WIDTH-1 do begin with PRGBTriple(@ImageData[y*LINE_PITCH+x*BYTES_PER_PIXEL])^ do begin // Here is where the mods would have to take place to // "reverse" the ordering. rgbtBlue := Byte(x and not 15); rgbtGreen := Byte(y and not 15); rgbtRed := Byte(rgbtBlue+rgbtGreen); end; end; end; [/code] __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

