Tuesday, March 1, 2011

Can your video handle 16, 256, 32768, 16777216, or more colors?

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:

function GetColorsCount : integer;
var
h : hDC;
begin
Result := 0;
try
h := GetDC( 0 );
Result :=
1 shl
(
GetDeviceCaps( h, PLANES ) *
GetDeviceCaps( h, BITSPIXEL )
);
finally
ReleaseDC( 0, h );
end;
end;

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Kang Iwan K-sev | Thank's for your visit To My Site - Ridwan Mulyana | Cibeureum