Author: Lou Adler
Can your video handle 16, 256, 32768, 16777216, or more colors?
Answer:
You can use WIN API function GetDeviceCaps() to calculate the number of colors
supported by the current video mode. To make it even easier to use, here's a
function that will simply return the number of maximum simultaneous colors current
video device can handle:
1 function GetColorsCount: integer;
2 var3 h: hDC;
4 begin5 Result := 0;
6 try7 h := GetDC(0);
8 Result :=
9 1 shl10 (
11 GetDeviceCaps(h, PLANES) *
12 GetDeviceCaps(h, BITSPIXEL)
13 );
14 finally15 ReleaseDC(0, h);
16 end;
17 end;