Per pixel RGBA from a png or UIImage

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

  1. thisma macrumors member

    Sep 9, 2008
    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,
  2. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    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


    Jun 15, 2000
  4. thisma thread starter macrumors member

    Sep 9, 2008
    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

    Dec 28, 2008
    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


Share This Page