onPreCapture

Description

This event is fired before an image or a document is captured.

Syntax

- (BOOL) onPreCapture: (id) sender

Parameters

ID sender: The current DcsUIVideoView object that triggers the event.

Return value

BOOL

Remarks

If YES is returned, the capture action is continued; if NO is returned, the capture action is cancelled and the event onCaptureFailure is not fired.

Example


@interface ViewController ()<DcsUIVideoViewDelegate>{
    DcsView *dcsView;
}
@end
 
@implementation ViewController
 
- (void)viewDidLoad {
    [super viewDidLoad];
     
    dcsView = [[DcsView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
 
    dcsView.videoView.delegate = self; 
    [self.view addSubview:dcsView];
}

- (BOOL) onPreCapture:(id)sender{
    //If NO is returned, the capture action will be cancelled.
    return YES;
} 

@end