Solved

How to detect Number of Colors currently set

Posted on 1998-11-22
2
155 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
ID: 1325155
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
ID: 1325156
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

821 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