Find the alpha value

Discussion in 'iOS Programming' started by iphonejudy, Jun 6, 2009.

  1. iphonejudy macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #1
    I saw a document find a alpha value like below,


    Code:
    return pixelData[y * width + x]/255;         
    But i got error ,Invalid operands to binary /
     
  2. admanimal macrumors 68040

    Joined:
    Apr 22, 2005
    #2
    It is impossible to tell what is going on with the amount of code you gave, but chances are that pixelData is a char array that holds the raw binary image data...and I'm guessing that you're not actually working with the same type of variable in your own objective-c code.
     
  3. iphonejudy thread starter macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #3
    I saw a hasalpha mehod to find the alpha value.But it finds the alpha value only for image.

    Its a great drawback that iphone doesnot have a method to find the alpha value for a pixel
     

Share This Page