Question

I am writing a camera application in iOS using phonegap/cordova

I am overlaying image using camera overlay function in camera live feed. The code is below.

UIImageView *overlay=[[UIImageView alloc]initiwithImage[UIImage imageNamed:@"camera.jpg"]];
Picker.overlay=overlay;
pickerController.overlay=overlay;

How to take a picture if I touch or click or tap on screen/ camera Live feed in iOS programatically using UITapGestureRecognizer

UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]
                     initWithTarget:self action:@selector(ClickEventOnImage:)];
    [tap setNumberOfTouchesRequired:2];
    [tap setDelegate:self];
    //Don't forget to set the userInteractionEnabled to YES, by default It's NO.
    overlay.userInteractionEnabled = YES;
    [overlay addGestureRecognizer:tap];

-(void)ClickEventOnImage:(id)sender
 {
   NSlog(@"tapRegonise");
  }

I am able to see output in my console as tapRegoniser. but instead i want to take a picture on that tap

For example how camera works in Nokia Lumia Phone's by pressing any where on screen it click a picture.

Was it helpful?

Solution

got the answer plz refer to WWDC 2010 videos (421 part in side Incorporating the Camera and Photo Library in your App)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top