CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2009
    Location
    Riga, Latvia
    Posts
    128

    Question Get pixel form either BITMAP or HBITMAP

    Hello!

    I have HBITMAP with some image in it. I need to work with the every single pixel in it. I.e. get it's RGB and possibly change it.

    I know, I have GetBitmapBits(), also, it seems, I have an option to get BITMAP from HBITMAP and work with bmBits field.

    What are other options to get to RGB value of each pixel? Options described above seems too ugly.

  2. #2
    Join Date
    Feb 2005
    Location
    Madrid (Spain)
    Posts
    511

    Re: Get pixel form either BITMAP or HBITMAP

    Sorry

  3. #3
    Join Date
    Feb 2009
    Location
    India
    Posts
    444

    Re: Get pixel form either BITMAP or HBITMAP

    You could try GetDiBits. It will give you an RGBQUAD structure array.
    «_Superman
    I love work. It gives me something to do between weekends.

    Microsoft MVP (Visual C++)

  4. #4
    Join Date
    Jul 2009
    Posts
    6

    Re: Get pixel form either BITMAP or HBITMAP

    Guy, the GetBitmapBits() its not to win32 its for Win16 bits in Win32 you can use the GetDIBits() function so you can use the GetObject to take the Bitmap to a HDC and then you can use it to GetDIBits() function and so go on. bye and good luck i hope i was useful!

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