Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detecting color depth-16 color, 256 color, or 32 bit color
#14
Set a flag.  That checks for 16 NON-BLACK colors.

If theres a black in those first palette entries, and then 16 other colors, that's NOT a 16-color palette.

For example:

Black
Red
Blue
Green
White
Black * 250

The above would count as 4 non-black colors, but there's a valid Black in the 5-color palette.  I wouldn't call that a 4-color image.

The <= 16 check is for:
  standard 16 color palette (black + 15 others)
OR
  non-black palette (someone swapped black for midnight blue.)

But it's going to glitch with:
  Black + 16 other colors, which is actually a 17-color palette and probably a 256 color image.



Subtle glitch, but one that a library function should account for.  You never know who or where a library ends up being exposed to.  Wink
Reply


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

Possibly Related Threads…
Thread Author Replies Views Last Post
Question using $color:32 colour names mid-program? hskakw 2 204 01-14-2026, 09:30 AM
Last Post: hskakw
Question Latest version of QB64PE or QB64 compatible with Windows XP (32-bit)? madscijr 14 1,976 09-30-2025, 08:10 AM
Last Post: hsiangch_ong
  Test to post a new Thread + question 32 or 64 bit Rudy M 2 538 09-09-2025, 04:10 PM
Last Post: Rudy M
  useful page: Value of constants for the Windows 32-bit API madscijr 4 664 08-15-2025, 06:35 PM
Last Post: SMcNeill
  _CLEARCOLOR evety color EXCEPT ...? madscijr 4 828 04-27-2025, 10:51 PM
Last Post: TempodiBasic

Forum Jump:


Users browsing this thread: 1 Guest(s)