Archived

This topic is now archived and is closed to further replies.

Sponge99

PCX files

Recommended Posts

Sponge99    122
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

Share this post


Link to post
Share on other sites
Sponge99    122
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

Share this post


Link to post
Share on other sites
LordElectro    122
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.

Share this post


Link to post
Share on other sites