Solved

How to detect Number of Colors currently set

Posted on 1998-11-22
2
161 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

691 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