CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2007
    Posts
    2

    Get pixel value (onclick)

    Hello,

    I'm kind of a newbie in Visual C++ and I'm doing a image processing project in which I need to get specific pixel values whenever I click on a bitmap image.

    I'd appreciate if you gave me some hints and code on how to do this

    Thanks

  2. #2
    Join Date
    Jul 2005
    Posts
    767

    Re: Get pixel value (onclick)

    Your question is not clear, explain clearly.
    One's mistake cannot be your excuse!

  3. #3
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Get pixel value (onclick)

    try CDC::GetPixel ()

  4. #4
    Join Date
    Apr 2007
    Posts
    2

    Re: Get pixel value (onclick)

    I want to get the pixel's value(RGB) and coordinates when I click on a point (pixel) inside a BMP image.

    Hope this explains it better.
    Thanks

  5. #5
    Join Date
    Jul 2005
    Posts
    767

    Re: Get pixel value (onclick)

    You will need to Add message Handler for WM_LBUTTONDOWN or Handle WM_LBUTTONDOWN message. you could use GetCursorPos API to get the coordinates of the mouse cursor and use GetPixel as Skizmo suggested to get the RGB value at the specified point.
    One's mistake cannot be your excuse!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured