473,327 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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 4678
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Skulled2003 | last post by:
Hi there, I was wondering if it was possible to get the screen display size and other associated properties somehow either using python modules or if possible using Tk methods. Thanks a lot. ...
2
by: Dale | last post by:
How do I determine the system/Windows color depth? For example if the user uses Control Panel\Display - Settings, and sets Color Quality to "Medium (16 bit)". I want to choose which bitmap...
11
by: Andrew Poulos | last post by:
Is there a safe way to get the version of IE? I've done a google and found this code: var version=0 if (navigator.appVersion.indexOf("MSIE") != -1) { temp = navigator.appVersion.split("MSIE");...
1
by: Stewart Lane | last post by:
Can the display member of a combobox who's datasource is a dataset generated from a SQl command in a data adpater BE SET to the concatenation of two fields, like fname+' '+lname? This is my SQL...
6
by: datamodel | last post by:
Hello I have an XML tree of which you can see a mini-version here: http://paste.uni.cc/11838 (the tree is actually over 30,000 levels deep) How do I count the depth of a given...
2
by: tagnum | last post by:
I have written a program for unlimited categories depth, which is in use for few ecommerce websites. Like many others, I used one SQL table to store the category relation (or the tree structure)....
4
Robbie
by: Robbie | last post by:
Hi again, does anybody know how to get the number of colours / colour depth which the display is set to use, in Visual Basic 6? (i.e. 8-bit, 16-bit or 32-bit) I know how to find out the...
0
by: =?Utf-8?B?Qm9ybkhvbHktS2luZ0xvcmR5?= | last post by:
I have this Problem everything i start my computer The Color Quality And The Screen Pixels ! The Color Quality Change to the lowest (4 Bit) and the Screen Pixels change to 800 by 600 pixels ! ...
7
by: Syoam4ka | last post by:
Hi, when I use the following code: Bitmap bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height); pictureBox1.DrawToBitmap(bmp, new Rectangle(0, 0, pictureBox1.Width, pictureBox1.Height));...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.