How to Determine Color Depth? 
Author Message
 How to Determine Color Depth?

--------------FFBF705A7B983F52C0767E47
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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

--------------FFBF705A7B983F52C0767E47
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
I am currently developing a Visual Basic 5 application that will be used
on both Windows 95 and NT computers.&nbsp; The application contains several
large BMP images.&nbsp; Two different versions of each image are available
(a 256-color version and a 24-bit color version).&nbsp; If the color depth
of the user's display is less than 16-bit color, I would like to display
the 256-color version.&nbsp; Otherwise, the 24-bit color version should
be displayed.&nbsp; How can I test to determine the display color depth
on a user's computer?&nbsp; Is there an API call for doing this?

<P>Thanks,

<P>Matthew J. Ricciardi
<BR>MicroServices

--------------FFBF705A7B983F52C0767E47--



Wed, 19 Apr 2000 03:00:00 GMT  
 How to Determine Color Depth?

Quote:
>How can I test to determine the display color depth on a
>user's computer?  Is there an API call for doing this?

Yes there is Matthew.

This is C++, but you should be able to translate this to VB quite
easily:

        HDC hDC = ::GetDC( NULL );
        const int Colours = GetDeviceCaps( hDC, BITSPIXEL );

The returned value is the number of bits of colour, so 4 is 16
colours, 8 is 256, 16 is 64K, etc.

Dave
----
Address is altered to discourage junk mail.
Remove ".---" for the real address.



Thu, 20 Apr 2000 03:00:00 GMT  
 How to Determine Color Depth?

Try this one
---------------------------------
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
-------------------------------

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




Fri, 21 Apr 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to Determine Color Depth?

2. How to Determine Color Depth?

3. How to Determine Color Depth?

4. Determine color depth

5. How do I determine the display color depth?

6. Determining Color Pallette Depth

7. Determine system color depth?

8. Determining color depth?

9. Determining Color Pallette Depth

10. Determining color depth?

11. Determining Color Pallette Depth

12. determining display color depth in VB4?

 

 
Powered by phpBB® Forum Software