SetPixel and colors

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mark

    #1

    SetPixel and colors

    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.
  • William DePalo [MVP VC++]

    #2
    Re: SetPixel and colors

    "mark" <mark@discussio ns.microsoft.co m> wrote in message
    news:79B6D0F6-8F1D-4C48-B691-F31EF728AA6A@mi crosoft.com...[color=blue]
    > 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:[/color]

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

    microsoft.publi c.win32.program mer.gdi

    Regards,
    Will


    Comment

    • William DePalo [MVP VC++]

      #3
      Re: SetPixel and colors

      "mark" <mark@discussio ns.microsoft.co m> wrote in message
      news:79B6D0F6-8F1D-4C48-B691-F31EF728AA6A@mi crosoft.com...[color=blue]
      > 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:[/color]

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

      microsoft.publi c.win32.program mer.gdi

      Regards,
      Will


      Comment

      Working...