SetPixel and colors

G

Guest

Somebody can explain me why if I put a color with SetPixel the color showed
is of another value? For example: I've to draw a grayscale image. The color
RGB(90,90,90) become RGB(40,45,60). In the Visual C++ 6 help I see:

Return Values
If the function succeeds, the return value is the RGB value that the
function sets the pixel to. This value may differ from the color specified by
crColor; that happens when an exact match for the specified color cannot be
found.

This happen when I set my diplay number of colors as 65.000: If I set the
display numbers of colors at 16000000 the colors I put with setPixel are
really diplayed on the screen. But I'm thinking: all the colors I want to
draw with SetPixel are out of range?? Yes. becouse all the colors are wrong
after SetPixel.

I want to copy a picture on the screen. I open the original picture with
Paint Shop Pro and all the colors are ok. I copy the screen with the "Print
Screen" button and copy it in PSP. All the color matchs the original. If I
reply the image with SetPixel, copy with "Print Screen" and put it in PSP the
colors are very diffents than originals.

WHY. This is not the first time I use SetPixel.

Tahnk you.
 
W

William DePalo [MVP VC++]

mark said:
Somebody can explain me why if I put a color with SetPixel the color
showed
is of another value? For example: I've to draw a grayscale image. The
color
RGB(90,90,90) become RGB(40,45,60). In the Visual C++ 6 help I see:

If no one resonds with better advice here you can post again in the graphics
group

microsoft.public.win32.programmer.gdi

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top