Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Number of colors in Win 95
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00064515
Message ID:
00064640
Views:
30
>Hi all,
>
>I've already asked this question in my "thank you" reply to Jim Booth,
>but it may not be so obvious since the subject was different.
>
>Anyway, would that be possible to determine the number of colors (256 or
>higher) used in Windows 95 (from FPW 2.6 app), and how? I'd like my
>users with more colors to able to use fancier bitmaps, and those with
>only 256 to use simple graphics instead. TIA,
>
>Srdjan

Srdjan,

First load FOXTOOLS with SET LIBRARY then call the function below:

* FUNCTION: NumColor.prg
* AUTHOR: George Tasker
* DATE: January 14, 1997 - 8:03 AM
* PURPOSE: Returns the number of colors
* for the display.

PRIVATE m.result
m.result = 0
m.getdc = RegFN('GetDC', 'I', 'I')
m.getdevcaps = RegFN('GetDeviceCaps', 'II', 'I')
m.releasedc = RegFN('ReleaseDC', 'II', 'I')
m.hdc = CallFN(m.getdc, 0)
IF m.hdc > 0
m.planes = CallFN(m.getdevcaps, m.hdc, 14) && 14 is the number of planes
m.pixels = CallFN(m.getdevcaps, m.hdc, 12) && 12 is the bits per pixel
m.result = 2 ^ (m.planes * m.pixels)
ENDIF
= CallFN(m.releasedc, 0, m.hdc)
RETURN m.result

hth,

George
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform