iphone - Take picture and set it to UIImageView in iOS -
this question has answer here:
is there way take picture on ipad without going through apple controls ? have seen bunch of apps this,
for example, when add new contact in iphone, on top left side shows add photo
when click on that, camera opens , takes pic , saves add photo
..
i want implement same functionality.. possible on ipad ?
what need , add button first, title "add photo" or custom image.
then on click of button add following code :
if (([uiimagepickercontroller issourcetypeavailable: uiimagepickercontrollersourcetypecamera] == no) return no; uiimagepickercontroller *cameraui = [[uiimagepickercontroller alloc] init]; cameraui.sourcetype = uiimagepickercontrollersourcetypecamera; [self presentviewcontroller: cameraui animated: yes completion:nil];
it open camera, click image , tap "use" , have implement uiimagepickercontrollerdelegate method imagepickercontroller:didfinishpickingmediawithinfo: , store uiimage wherever want, whatever file name want, using nsfilemanager methods.
Comments
Post a Comment