?
Solved

How to detect Number of Colors currently set

Posted on 1998-11-22
2
Medium Priority
?
162 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 200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

752 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