I want use custom camera and due to some security purpose i do not want to save capture images in my gallery.
Thanks in Advance.
UIImage *imgTaken;
NSString *docsDir,*imgNewPath;
NSData *imgData;
NSFileManager *filemgr;
dirPaths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
docsDir = [dirPaths objectAtIndex:0];
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
imgTaken = info[UIImagePickerControllerOriginalImage];
imgNewPath = [docsDir stringByAppendingPathComponent:[NSString stringWithFormat:@"name your image"]];
imgData = UIImagePNGRepresentation(imgTaken);
[imgData writeToFile:imgNewPath atomically:YES];
[picker dismissViewControllerAnimated:YES completion:nil];
}
i hope it will help you.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.