Hello,

Could anybody help please.

I am really confused on how the PAL_INDEXED and PAL_BGR/PAL_RGB affects the
color supported of my monochrome driver.

Here are the values of my GDIINFO:

-->
cBitsPixel = 1
cPlanes = 1
ulNumColors = 2
<--

The default palette entries of my driver is black and white.
I got this by using GetPaletteEntries() in my driver.

Using GetDeviceCaps(), I can get the NUMCOLORS as 2 which is I assumed to
be correct since it only supports 2 colors.

Using GetNearestColor(), the following results were achieved:

Input RGB Output RGB
--------- ----------

(0,0,0) (0,0,0)
(1,0,0) (0,0,0)
(1,1,0) (0,0,0)
(127,127,127) (0,0,0)
(128,128,128) (255,255,255)
(254,254,254) (255,255,255)
(255,255,255) (255,255,255)

I wanted to modify the default palette using EngCreatePalette.
My first option was to use PAL_INDEXED but since this is a monochrome driver,
my assumption is that the default number of entries in the palette is not
growable.

So, I decided to use PAL_BGR instead.

-->
EngCreatePalette(PAL_BGR, 0, NULL, 0, 0, 0);
<--

After passing the handle to DEVINFO, I assumed that the work is done.

Using GetDeviceCaps() again, the NUMCOLORS is still 2.
Using GetNearestColor(), I got the following results:

Input RGB Output RGB
--------- ----------

(0,0,0) (0,0,0)
(1,0,0) (1,0,0)
(1,1,0) (1,1,0)
(127,127,127) (127,127,127)
(128,128,128) (128,128,128)
(254,254,254) (254,254,254)
(255,255,255) (255,255,255)


With this, I have these questions that really make me confused.
1. After modification, why is it the GetNearestColor() returns exactly the same
RGB values with the input RGB?

2. Does this mean that PAL_BGR instructs GDI that virtually all colors
(RGB = 16777215)is now supported by my driver/device?

3. If my driver instructs GDI that all colors are supported though my device
is a mere monochrome, what would happen?

Thank you and Regards.
alvin