Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Intelligent Spash Screens
Message
 
À
30/07/1997 22:59:52
Christopher Holtz
Integral Computer Services, Inc.
Rochester, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00042562
Message ID:
00042596
Vues:
30
>I have an application that displays a splash screen created in the 16-bit color palette (high-color). Naturally, it looks beyond horrible in 256 colors. I would like to toggle images depending on what color palette is being used by the operating system.
>
>I am certain foxpro is capable of detecting what color pallet Windows 95 is using, however, the solution eludes me right now. I thought it might be available through declare dll (using the window 95 api). Any thoughts?

Christopher,

This should give you all you need in this area. First, declare the following API functions

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)

HTH,

George
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