Determine Color Mode (16, 256, 16k) of Windows 
Author Message
 Determine Color Mode (16, 256, 16k) of Windows

How can I determine how many colors the current graphics mode is running
from VB 4.0?  (ie. 16, 256 colors)

- Rich



Sun, 10 Dec 2000 03:00:00 GMT  
 Determine Color Mode (16, 256, 16k) of Windows

Hi richie

R = GetDeviceCaps(hDC, BITSPIXEL)

R will be the color depth, i.e. nColors = 2^R. For instance, for 256 colors
you will get R = 8.

Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal
nIndex As Long) As Long
Private Const BITSPIXEL = 12

regards,
Niels

Quote:

>How can I determine how many colors the current graphics mode is running
>from VB 4.0?  (ie. 16, 256 colors)

>- Rich




Mon, 11 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Determine Color Mode (16, 256, 16k) of Windows

2. HELP - detecting if windows in 256 or 16-bit color modes

3. Bitmap Color Palette editing-VB4 16 bit 256 color

4. 256 Color Icons only 16 colors?

5. Bitmap Color Palette editing-VB4 16 bit 256 color

6. Pallette flashing between windows in 256 color mode?

7. Custom 24-bit colors in 256-color mode

8. colors wrong in 256 color mode

9. 256 or 16 color

10. 256 or 16 color

11. 256 vs. 16 color systems

12. Saving 16/256 color bitmaps

 

 
Powered by phpBB® Forum Software