Solved

How to detect Number of Colors currently set

Posted on 1998-11-22
2
149 Views
Last Modified: 2013-11-20
I am writing a dialog to show bmp files but the bmp files were created with more than 256 colors so I need to know if the user's current screen settings are set to greater than 256 colors. Is there a way to detetermine this?
0
Comment
Question by:rascal
2 Comments
 
LVL 12

Accepted Solution

by:
migel earned 100 total points
Comment Utility
Hi!
GetDeviceCaps(hScreenDC, BITSPIXEL) can help you.
for example:
HDC hdcScreen = ::GetDC(NULL);
int nColors = ::GetDeviceCaps(hScreenDC, BITSPIXEL);
nColors = 1<<nColors;
::RelesaeDC(NULL, hdcScreen);
0
 
LVL 2

Expert Comment

by:wyy_cq
Comment Utility
in MFC you also can do like this.

CClientDC dc(NULL);// get screen DC
i=dc.GetDeviceCaps(...);
// need not release the DC
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now