Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Video Display and Graphics
Message
From
05/03/1999 20:04:12
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00194398
Message ID:
00194749
Views:
20
>>>>To All:
>>>>
>>>>I know this has been cussed and discussed before but I could not find the threads on my particular problem.
>>>>
>>>>I have developed an application and my video setting are 16 bit high color. But if I run this on a computer with setting of 256 colors or less the screens and images change color. I can understand why, but what do you do to make an application compatible with different display settings? Does Visual Basic handle is problem better.
>>>>
>>>
>>>You have a choice - design to the least common denominator that you're willing to support (in this case, the 256 color mode) or create color mappings for each color depth and switch them as needed. The best way to determine the color depth is using the Win32 API call GetDeviceCaps() to retrieve the BITPIXEL property for the current Display as follows:
>>>
>>>
DECLARE INTEGER CreateDC IN WIN32API ;
>>>   STRING @ lpszDriver, ;
>>>   INTEGER lpszDevice, ;
>>>   INTEGER lpszOutput, ;
>>>   INTEGER lpInitData
>>>LOCAL hDCScreen
>>>hDCScreen = CreateDC('DISPLAY'+CHR(0),0,0,0)
>>>DECLARE INTEGER GetDeviceCaps IN WIN32API ;
>>>   INTEGER hDC, ;
>>>   INTEGER nIndex
>>>#DEFINE BITSPIXEL 12
>>>? GetDeviceCaps(hDCScreen,BITSPIXEL)
>>>
>>>
>>>There are a ton of functions to handle color mapping; The Windows 98 Developer's Guide is a good reference, as are the entries under the topic Device Context Functions in the MSDN.
>>
>>This all sounds quite complex. I might opt for requiring certain minimum hardware.
>>
>>Thanks
>
>No problem; if you do elect to require specific hardware support, the value returned from GetDeviceCaps() will tell you the color mode (16= High Color, bigger is greater color depth.) You may want to give a warning and let the user change video resolutions; many drivers can change color modes without requiring Windows to shut down, or even for any given app to close. People sometimes will switch color modes for a game, and you might as well give them a chance to switch or exit the app.

Thanks for all the good info and advice.
Robert
Previous
Reply
Map
View

Click here to load this message in the networking platform