Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
16 colors - 256 colors - how to determine?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00109377
Message ID:
00132334
Vues:
26
>Don't you want to make this a FAQ? Thanks.
>
>Vlad
>
>>You have to use the API. Here's a function that will do it:
>>FUNCTION NumColors
>>
>>DECLARE INTEGER GetDC IN Win32API;
>>  INTEGER hWnd
>>DECLARE INTEGER GetDeviceCaps IN Win32API;
>>  INTEGER hDC, INTEGER nIndex
>>DECLARE INTEGER ReleaseDC IN Win32API;
>>  INTEGER hWnd, INTEGER hDC
>>LOCAL lnresult, lnhDC, lnplanes, lnpixels
>>lnresult = 0
>>lnhDC = GetDC(0)
>>IF lnhDC > 0
>>  lnplanes = GetDeviceCaps(lnhDC, 14) && 14 is the number of planes
>>  lnpixels = GetDeviceCaps(lnhDC, 12) && 12 is the bits per pixel
>>  lnresult = 2 ^ (lnplanes * lnpixels)
>>  = ReleaseDC(0, lnhDC)
>>ENDIF
>>RETURN lnresult
>>hth,

Hi Vlad,

Actually, I thought I had. But, since I haven't, I'll do so today or tomorrow.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform