Reputation: 16859
I am looking for a tutorial where i can take a picture using my iPhone and save it on the phone. I googled this but was not able to find any tutorial or sample code to begin with. Can someone please help me by pointing out a tutorial or sample code?
Upvotes: 0
Views: 253
Reputation: 510
UIPicker.sourceType=UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:UIPicker animated:YES];
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo {
//code to save image in gallary
UIImageWriteToSavedPhotosAlbum(receivedImage, nil,nil, nil);
//close the picker
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
}
-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
//close the picker
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
}
Upvotes: 1
Reputation: 29767
For getting image by camera see this articles:
Camera Programming Topics for iOS
UIImagePickerController Class Reference
Upvotes: 2
Reputation: 3927
Take a look to UIImagePickerController
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html
Upvotes: 3