Re: Image has wrong colors

Tech-Archive recommends: Speed Up your PC by fixing your registry



On Thu, 17 Jan 2008 22:24:13 -0800, Michael C <mike@xxxxxxxxxx> wrote:

Can you save the data to a file and open it using an image program? Does it
look the same as what you get in C#?

I suspect that if he saves the buffer out to a file, he'll get the same results. But I agree that would be a good test. It would at least confirm that it's the data itself that's not being interpreted correctly, as opposed to some other problem.

LockBits gives you high speed access to the raw data in a bitmap object.
It's possible if it's coming across from a linux box that it's a little/big
endian issue and the RGB values are just back to front.

That's not a bad guess, but I would be surprised if it's the actual issue. Byte order for JPEG data is well-defined regardless of platform (big-endian) so no JPEG-aware code should be messing with the order. So unless at some point something that's not JPEG-aware is reading the byte stream and swapping the bytes explicitly, the byte ordering within the stream shouldn't change. And even if that did happen, more than just the RGB values would be messed up.

Try attaching the bitmap to a post, I know that's frowned apon here but we
can cope with 1450 bytes.

Well, a) many ISPs will block _any_ attachment, no matter how small, and b) he's reading data 1450 at a time, but the bitmaps themselves are larger than that. He doesn't say how large a full frame is, and it will vary from frame to frame never mind according to the frame resolution and rate, but I'd guess that even at a lower resolution like 320x240 a single frame would be 20K or so.

Much better, if it's useful to share the data at all, is to put it on a website for download. Here are links for three of the many free websites that offer upload/download services:

http://www.filecrunch.com/
http://www.sendspace.com/
http://www.yousendit.com/

Of course, many people have some sort of personal web site or similar where they can put files as well. In any case, copying the file to some place like that is much better than having the data inflated some 30% or more by the MIME encoding, and then copied everywhere in the world, to every server carrying the newsgroup and to every user downloading messages, even though a handful of people at most will ever actually look at it.

:)

Pete
.