>Regarding the code to determine the number of colors available, is that available in the files? I would be interested in obtaining this information also. Thank you.
>Marcus.
>
>>I just copied the great code by George Tasker which determines the number of colors
>>available. Along those same lines... is there any way to tell which resolution setting
>>is in effect (640 x 480, 1024 x 768, ...)?
>>
>>thanks in advance
I copied this to a txt file when it was posted. Enjoy.
- Chris Holtz
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
* Next, get a valid (greater than zero) device context
lnhDC = GetDC(0)
* Get the number of planes
lnplanes = GetDeviceCaps(lnhDC, 14)
*Get the bits per pixel
lnpixels = GetDeviceCaps(lnhDC, 12)
*Calculate the number of colors
lnnumclrs = 2 ^ (lnplanes * lnpixels)
*Finally, release the device context
= ReleaseDC(0, lnhDC)
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement