How to use getpixel() and setpixel() in C program for selecting pixels

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rohit Ramesh
    New Member
    • Mar 2010
    • 5

    How to use getpixel() and setpixel() in C program for selecting pixels

    How to use getpixel() and setpixel() in C program for selecting all pixels of an image of a camera? image size is 160*120..
  • newb16
    Contributor
    • Jul 2008
    • 687

    #2
    setpixel() is not a part of a C standard, so the formal answer is 'not enough information'. But as setpixel() you mention is most likely related to Borland BGI library, the answer is "you can't " - these functions don't access camera.

    Comment

    • Rohit Ramesh
      New Member
      • Mar 2010
      • 5

      #3
      Ok. I got an assignment to write C program using getpixel() in order to choose pixels of image..
      like getpixel(1,2) will choose pixel of 1st row and 2nd column.. Similarly, to write C program to choose image of size 160*120 in Array using '"while" and "for" loop

      Comment

      • newb16
        Contributor
        • Jul 2008
        • 687

        #4
        Are you expected to write something like this?
        for(...) for(...) array[y][x]=getpixel(x,y);
        It's still not clear where do you get the image.

        Comment

        Working...