• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

Getting 256 Color HPALLET

I use CreateDC( NULL ) -- The screen DC,
in order to get the HPALLET of the screen.
I use GetDeviceCaps to determine if the HDC supports HPALLET entries, but it doesnt.
Is there any problem with NT (4.0) or any settings that should be done to the DC in order to get that pallet?

Is there any other way to prepare a 256 color pallete? (Most preffered)

0
shaig
Asked:
shaig
  • 2
1 Solution
 
chensuCommented:
It is most likely that your display setting is set to more than 256 colors, such as 16-bit, 24-bit. In these cases, there is no palette support. You may use the CPalette::CreateHalftonePalette
function to create a halftone palette.
0
 
shaigAuthor Commented:
Is there a way to create a pallete wit no device dependency?
0
 
chensuCommented:
What do you mean? You can create a palette that contains any colors you want. Have a look at my article at CodeGuru.

Paint a gradient color background
http://www.codeguru.com/bitmap/gradient_palette.shtml
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now