Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

determine bbp (bits per pixel)

Status
Not open for further replies.

djdidge

Programmer
May 9, 2001
65
GB
basically i need to find out the colour settings of my PC.
Preferably using the framework.

Ideas?

Regards

DiDGE
 
tried using this API...

Private Const BITSPIXEL = 12

Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As Long



...
MsgBox("This system is using " & Format$(GetDeviceCaps(Me.Handle.ToInt64, BITSPIXEL)) & "-bit color.")

this returns a stupidly large number like 23254235363
 
thanks to the TheLearnedOne for this answer in another forum..............................................


Private Const BITSPIXEL As Integer = 12

Private Declare Function GetDeviceCaps Lib "gdi32" _
(ByVal hDC As Integer, ByVal nIndex As Integer) As Integer

Private Declare Function GetDesktopWindow Lib "User32.dll" () As Integer

Private Declare Function GetWindowDC Lib "User32.dll" (ByVal hWnd As IntPtr) As Integer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim hDc As Integer = GetWindowDC(Me.Handle)

Dim capsForm As Integer = GetDeviceCaps(hDc, BITSPIXEL)

MsgBox("This system is using " & capsForm & "-bit color.")

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top