Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rup28aug

macrumors newbie
Original poster
Oct 22, 2008
12
0
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
 
Look into UIImagePickerController.

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
 
I have a button on my view controller class
i want to capture a photo when user touch on this button

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).
 
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

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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.