Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Detemining screen color depth

From Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): N78
Platform(s): S60 3rd Edition (initial release, FP1, FP2)
S60 3rd Edition FP2
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Keywords: keywords=HAL::Get()
Created: lming (01 Nov 2008)
Last edited: hamishwillee (01 Aug 2012)



This snippet demonstrates how to retrieve the screen color depth of S60 3rd Edition devices. This snippet can be self-signed.

Use case

Some color depths for S60 3rd Edition devices are 16 bit (65,536), 18 bit (262,144), and 24 bit (16,777,216). Some devices that have these color depths: N92 (16 bit), 3250 (18 bit), and E61 (24 bit).

An application could detect the color depth and load compatible images (that have the same color depth as the screen), for example.

Source file

//necessary library
//necessary header file
#include <HAL.h>
#include <hal_data.h>
//displayColors contains color depth of this device
TInt displayColors;
//retrieve EDisplayColors value of this phone
HAL::Get( HALData::EDisplayColors, displayColors );


The displayColors variable contains the color depth of this device. For example, on a N78 this value would be 16,777,216 (24 bit).

This page was last modified on 1 August 2012, at 05:38.
39 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.