How do I get the color depth of the screen/display adapter with vb.net
2003?
Background: We're having transparency problems (long side story and
known Windows "bug") that requires our systems to have the Color Depth
or "Color Quality" (bits per pixel) of the display adapter (screen) to
be 16 bits (Called "Medium (16 bit)" in the Display Properties Control
Panel) in order for it to work.
All I've been able to find are antique code examples using API calls
such as GetDeviceCaps, EnumDisplaySettings, etc. Isn't there some new
..Net way of finding out the colordepth like
Screen.whatever or
System.Windows.Forms.something?
I sure couldn't find any (after a long time of trying things like web
searches, MSDN, etc.) but surely there must be some way.
Then I could alert the user that they are in 32 bit colordepth and they
need to change their display properties to 16 bit. Bonus points if you
can tell me how to do the switch from 32 or 24 bits per pixel into 16
bits per pixel right in the my program's code without exiting the
program and doing it via the "Color Quality" drop down in the Display
Properties control panel.
Antique (I think) code examples:
http://abstractvb.com/code.asp?A=947
http://www.developerfusion.co.uk/show/268/
To recap:
1: What is the .Net code to retrieve display color depth?
2. What is the .Net code to change it on the fly?
Mark