Solved

How to detect Number of Colors currently set

Posted on 1998-11-22
2
152 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

919 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

22 Experts available now in Live!

Get 1:1 Help Now