
How to Determine Color Depth?
Try the following:
------------------------------
Const BITSPIXEL = 12 ' Number of bits per pixel
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long,
ByVal nIndex As Long) As Long
Private Sub Form_Load()
MsgBox GetDeviceCaps(hdc, BITSPIXEL)
End Sub
-----------------------------------
Note: The BITSPIXEL constant and the declare are available in the
winapi.txt file that shipd with VB5.
On Sat, 01 Nov 1997 00:26:01 -0500, "Matthew J. Ricciardi"
Quote:
>I am currently developing a Visual Basic 5 application that will be used
>on both Windows 95 and NT computers. The application contains several
>large BMP images. Two different versions of each image are available (a
>256-color version and a 24-bit color version). If the color depth of
>the user's display is less than 16-bit color, I would like to display
>the 256-color version. Otherwise, the 24-bit color version should be
>displayed. How can I test to determine the display color depth on a
>user's computer? Is there an API call for doing this?
>Thanks,
>Matthew J. Ricciardi
>MicroServices