Take picture from iPhone programmatically

Discussion in 'iOS Programming' started by rup28aug, May 27, 2009.

  1. rup28aug macrumors newbie

    Joined:
    Oct 22, 2008
    #1
    hi all,
    i am new to iPhone programming
    i want to capture a photo from iphone programmatically. I have no idea that how can do this task
    can anybody provide me a useful link or sample application?

    Thanks
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
  3. rup28aug thread starter macrumors newbie

    Joined:
    Oct 22, 2008
    #3
    I have a button on my view controller class
    i want to capture a photo when user touch on this button

    i read the document about UIImagePickerController but i am unable to apply. can you suggest me some step what i do when user click on button

    thanks
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    You can't do that. You can only open the image picker setting the sourceType to UIImagePickerControllerSourceTypeCamera. This will show the standard interface to the user with a button to take a picture. You can retrieve that via the delegate.

    If you can't work it out from that (you should be able to, this is simple stuff) then search on the developer portal and you should find some sample code (I'm not going to search for you).
     
  5. North Bronson macrumors 6502

    Joined:
    Oct 31, 2007
    Location:
    San José
    #5
    There might be a simpler way to do this, but I know that you could capture the current context to a bitmap with Core Graphics, save that bitmap to an NSMutableData object, then just write it to disk.
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    Yeah, we're not sure but we suspect the OP wants a photo from the camera. If that's not the case, they'll need to come back and clear up this concern.
     

Share This Page