Per pixel RGBA from a png or UIImage

Discussion in 'iOS Programming' started by thisma, Sep 12, 2008.

  1. thisma macrumors member

    Joined:
    Sep 9, 2008
    #1
    Thank you

    I'm trying to find the color data, most importantly the alpha, for an arbitrarily chosen point or pixel in a png I have assigned to a UIImage.
    My friend and I have been searching google and the frameworks for hours with no leads.

    Please help,
    thisma
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    Core Graphics. Create a bitmapcontext, draw your image into the context, read the pixels to your heart's delight.

    google CGBitmapContextCreate & CGContextDrawImage
     
  3. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #3
  4. thisma thread starter macrumors member

    Joined:
    Sep 9, 2008
    #4
    That's probably enough for us to state making it work. I'm concerned that this will be more memory intensive than I'd like.
    The main thing still remaining is, I'm a little bit of a noob and I don't see what to write to pull the data from pixel x,y. I'll read over it again though.

    BTW thank you both of you.
     
  5. swyitch macrumors newbie

    Joined:
    Dec 28, 2008
    #5
    did you guys figure out a solution for this?

    im am in desperate need of knowing how to do this, please post solution if you have one

    -jeff
     

Share This Page