469,934 Members | 1,750 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

Getting Color Depth / Quality of display adpater / screen

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

Feb 16 '06 #1
5 4504
Hi Mark,

AFAIK, there is no managed way in .NET 1.x.

In .NET 2.0 you have My.Computer.Screen.BitsPerPixel

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
<ha******@hotmail.com> escribió en el mensaje
news:11**********************@o13g2000cwo.googlegr oups.com...
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

Feb 16 '06 #2
JJ
Well done on getting a reply Mark. I guess it must by the way I word my
questions....!

At least we know now - thanks Carlos.
"Carlos J. Quintero [VB MVP]" <ca*****@NOSPAMsogecable.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi Mark,

AFAIK, there is no managed way in .NET 1.x.

In .NET 2.0 you have My.Computer.Screen.BitsPerPixel

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
<ha******@hotmail.com> escribió en el mensaje
news:11**********************@o13g2000cwo.googlegr oups.com...
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


Feb 16 '06 #3
Carlos:
Thanks for your extemely quick response. I got no Intellisence for MY.
so I guess I'm using .Net 1.x. I tried to upgrade to VS2005 but it
said I had to have XP Service Pack 2 installed (which apparently my
company hasn't for some reason - it's not part of our official standard
platform yet). So 2 more questions:
1. Is it possible to use .Net 2.0 with VS2003?
2. Can anyone give code that will get the job done in VB.Net 2003? (I
tried the antique code above and it didn't seem to work)
Thanks,
Mark

Feb 16 '06 #4
<ha******@hotmail.com> schrieb
Carlos:
Thanks for your extemely quick response. I got no Intellisence for
MY. so I guess I'm using .Net 1.x. I tried to upgrade to VS2005 but
it said I had to have XP Service Pack 2 installed (which apparently
my company hasn't for some reason - it's not part of our official
standard platform yet). So 2 more questions:
1. Is it possible to use .Net 2.0 with VS2003?


No.
Armin
Feb 16 '06 #5
Hi,

1) No

2) See: http://dotnet.mvps.org/dotnet/faqs/?...lution&lang=en

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
<ha******@hotmail.com> escribió en el mensaje
news:11*********************@f14g2000cwb.googlegro ups.com...
Carlos:
Thanks for your extemely quick response. I got no Intellisence for MY.
so I guess I'm using .Net 1.x. I tried to upgrade to VS2005 but it
said I had to have XP Service Pack 2 installed (which apparently my
company hasn't for some reason - it's not part of our official standard
platform yet). So 2 more questions:
1. Is it possible to use .Net 2.0 with VS2003?
2. Can anyone give code that will get the job done in VB.Net 2003? (I
tried the antique code above and it didn't seem to work)
Thanks,
Mark

Feb 17 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Skulled2003 | last post: by
2 posts views Thread by Dale | last post: by
11 posts views Thread by Andrew Poulos | last post: by
1 post views Thread by Stewart Lane | last post: by
6 posts views Thread by datamodel | last post: by
reply views Thread by =?Utf-8?B?Qm9ybkhvbHktS2luZ0xvcmR5?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.