Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2007

    Comparing pixel color and getRGB's returned array

    I'm beginning to work with with the graphics class and at the moment I'm trying to devise how to find a black vertical line in an image (it's the full height of the image). Since I don't see any methods for outright checking a specific pixel's color, I'm working under the assumption that I need to extract the RGB from an image, then compare the red within a certain threshold to decide I have black. However, since getRGB returns a one dimensional array do I need to use modulus or such to determine where each new row in my image is within the array?

    edit: sorry, changed the title since the old one didn't make much sense
    Last edited by nurru; 2007-05-06 at 20:15.

  2. #2
    Super Contributor
    Join Date
    Mar 2003

    Re: Comparing pixel color and get___Component()

    You need integer division by the width of the image to get the y coordinate and modulus by the width to get the x coordinate.


Posting Permissions

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