PCX files

Started by
2 comments, last by Sponge99 22 years, 8 months ago
Loading PCX files -> nothing should be easier, right? well, I'm, i'm having some trouble... I've got the RLE stuff down and I can draw a square to the screen that has the dimensions of the image, BUT, all of the pixels are the same color. After loading the header, I fseek(...) to 128 after SEEK_SET, and then just use fread(...) to get my data. It seems as though all of the pixels are the same color when I read them, does anyone think they know whats going on? I of course can give a more detailed description of what I'm doing if you really want it.... edited part: oh yeah, 16bit color, 640x480 screen, writing to back buffer with my own looping pel-by-pel copy thingy, then flipping. Thanks! -Sponge99 Edited by - Sponge99 on August 1, 2001 3:21:00 AM
"Now watch as I run away in a womanly fashion." - Batman
Advertisement
What bit depth are you using for the PCX files?
BetaShare - Run Your Beta Right!
I am using 8 bit depth, which equals 24-bit color, correct?
8-bits per channel, 3 channels, 24-bit color. It isn''t palletized, I think...(i made it in adobe photoshop 5.5)

Sponge99
"Now watch as I run away in a womanly fashion." - Batman
If your using 8 bit, that IS palettized

And that''s probably where your problem lies, you''re trying to read it wrong. 8 bit means 1 byte per pixel, and that byte corresponds to the color in the PCX file''s palete, which is located in that last 768 bytes of the file if I remember correctly.
BetaShare - Run Your Beta Right!

This topic is closed to new replies.

Advertisement