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

    Read Pixels in Bytes

    I have a picture on a picture box.
    I need to read or get every byte of the picture.
    One pixel consists of 3 bytes(24 bits). I need to get byte by byte.
    The GetPixel function only gets the pixel value which consists of 3 bytes or less.

    Please help me.
    Dev.


  2. #2
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: Read Pixels in Bytes

    This is the simpler method: GetPixel and divide it into the separate R, G and B components


    col = GetPixel(10,10)
    red = col and &hff
    green = (col and &hff00&)/&h100&
    blue =(col and &hff0000)/&h10000




    But it is relatively slower. A faster (and more complicated) method would be to use SAFEARRAY or use GetDIBits() API to get the bytes of the image.


  3. #3
    Join Date
    Apr 1999
    Posts
    19

    Re: Read Pixels Using GetDIBits()

    How do I use the GetDIBits() function to get bytes of the pixels on an image.
    I need to get every 64 bits of the image.
    Please help

    Dev.


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