Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Monitor info
Message
From
21/05/1999 08:06:39
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00221260
Message ID:
00221300
Views:
15
I've seen this question many times here. Maybe you can add it as a new FAQ... if you have time. Thanks.

Vlad

>You need several API calls:
>
>
DECLARE INTEGER GetDC IN WIN32API INTEGER hWnd
>DECLARE INTEGER GetActiveWindow IN WIN32API
>DECLARE INTEGER GetDeviceCaps IN WIN32API ;
>   INTEGER hDC, ;
>   INTEGER nIndex
>DECLARE INTEGER ReleaseDC IN WIN32API INTEGER hDC
>#DEFINE BITSPIXEL 12
>LOCAL nDC, nBitsPerPixel
>nDC = GetDC(GetActiveWindow())
>nBitsPerPixel = GetDeviceCaps(nDC, BITSPIXEL)
>=ReleaseDC(nDC)
>
>nBitsPerPixel returns the color depth; 8 = 256 Color, 16 = High Color (64K), 24 or 32 are TrueColor modes. There are other values; these are the most common ones encountered.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform