Tuesday, 15 February 2011

iphone - How to capture picture without user interaction in iOS? -



iphone - How to capture picture without user interaction in iOS? -

i working on mobile tracing app iphone. want capture image of user without user interaction. have searched on google found 2 links don't meet requirements. found can using avcam , avfoundation. there sample code related this? have sample code?

-takepicture should trick in deed. have provider custom ui photographic camera controls, because otherwise (for me) doesn't work. check out developer documentation in xcode , search takepicture. method description has need.

following provide simple logic you:

- (ibaction) showcameraui { uiimagepickercontroller *picker; // create , display picker self.imagepicker = imagepicker; [nstimer scheduledtimerwithtimeinterval:4.0 target:self selector: @selector(targetmethod) userinfo:nil repeats:yes]; } - (void)targetmethod { [self.picker takepicture]; // ... }

other alternative is

i found that...

avcapturevideodataoutputsamplebufferdelegate

to take pictures automatically.

- (void)captureoutput:(avcaptureoutput *)captureoutput didoutputsamplebuffer:(cmsamplebufferref)samplebuffer fromconnection:(avcaptureconnection *)connection

checke official document , this link source of code.

it pretty simple , give thanks you:)

iphone ios objective-c avfoundation

No comments:

Post a Comment