Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detecting color depth-16 color, 256 color, or 32 bit color
#5
(08-16-2024, 01:04 PM)dano Wrote:
(08-16-2024, 12:55 AM)SMcNeill Wrote: There's an issue with trying to sort between 16-color and 256-color images.  The problem is that both use 1 byte-per-pixel in memory, so you may need to compare against _PALETTECOLOR to distinguish between the two.
Works like a charm.  Once again, thank you Steve!

Note that it's not fool-proof.  Most things seldom are.  The power of fools is astounding!

Some fool out there might have a 256-color image, and 240 of the colors are all full alpha BLACK...  That'd still detect as a 16-color palette.

It's not *likely* to happen to you, but one should never rule out the impossible with stuff.  Just keep it in the back of your mind, in case you ever get some odd glitches sometime and need to deal with them.
Reply


Messages In This Thread
RE: Detecting color depth-16 color, 256 color, or 32 bit color - by SMcNeill - 08-16-2024, 01:20 PM



Users browsing this thread: 13 Guest(s)