473,765 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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, EnumDisplaySett ings, 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 4700
Hi Mark,

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

In .NET 2.0 you have My.Computer.Scr een.BitsPerPixe l

--

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******@hotma il.com> escribió en el mensaje
news:11******** **************@ o13g2000cwo.goo glegroups.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, EnumDisplaySett ings, 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*****@NOSPAM sogecable.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi Mark,

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

In .NET 2.0 you have My.Computer.Scr een.BitsPerPixe l

--

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******@hotma il.com> escribió en el mensaje
news:11******** **************@ o13g2000cwo.goo glegroups.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, EnumDisplaySett ings, 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******@hotma il.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******@hotma il.com> escribió en el mensaje
news:11******** *************@f 14g2000cwb.goog legroups.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
1629
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. Vinod __________________________________________________________________ Switch to the New Netscape Internet Service.
2
2051
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 image to display, based upon the color quality supported. I thought this would be in the environment class, but can't find it. Thanks.
11
2711
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"); version = parseFloat(temp); } but I have no idea how "robust" it is.
1
1583
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 command: SELECT custnumb, fname, lname FROM custmstr ORDER BY lname, fname I've also tried: SELECT custnumb, fname+' '+lname as flname FROM custmstr ORDER BY lname, fname (and trying to set the display member to flname - but it wasn't
6
7222
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 <NODES><NODE????? The problem is I would like to "color" nodes based on their depth in the tree - ie, use alternating colors.
2
2211
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). E.g. child_id & parent_id. To cope with the "unlimited" nature, the htaccess file & html ul list are generated on the fly. To sum it up, it has SEO friendly URLs, breadcrumbs, CSS driven navigation bar, category ordering in the backend, etc. But I...
4
1726
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 horizontal/vertical resolution, but it's the depth I need...
0
1000
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 ! soo EVERYTIME , i start the computer I NEED TO CHANGE IT BACK to highest (32 Bit) and 1024 by 768 ! And i cant even play games ! becuase it never change the games window to 1024 by 768
7
1788
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)); this.ClearPic(); this.pictureBox1.Image = bmp; it seems like the quality of the picrture degrades and it loses of its color depth - why? How can I fix it? Thanks
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.