IOS 调用摄像头
来源:互联网 发布:手机地球仪软件中文版 编辑:程序博客网 时间:2024/06/05 20:49
@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. UIButton *button=[UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame=CGRectMake(0, 0, 200, 50); [button setTitle:@"aa" forState:UIControlStateNormal]; [button addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:button];}-(void)click:(UIButton *)btn{ UIImagePickerController *imagePicker=[[UIImagePickerController alloc] init]; imagePicker.delegate=self;// imagePicker.view.frame=s if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){ imagePicker.sourceType=UIImagePickerControllerSourceTypeCamera; } // imagePicker.allowsEditing=YES;// [self.view addSubview:imagePicker.view];[self presentViewController:imagePicker animated:YES completion:^{ }];}- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo { }- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ [self dismissViewControllerAnimated:YES completion:nil]; NSLog(@"%@",info); UIImage *image=[info objectForKey:UIImagePickerControllerOriginalImage]; self.image.image=image;}- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{ [self dismissViewControllerAnimated:YES completion:^{ }];}
0 0
- ios调用摄像头
- iOS之摄像头调用
- IOS 调用摄像头
- IOS 调用摄像头拍照
- iOS调用相册和摄像头
- ios调用相册和摄像头
- iOS调用相册和摄像头
- iOS调用相册和摄像头
- cocos2d-x调用ios的摄像头
- ios 调用系统相册和摄像头
- ios 通过调用系统摄像头拍照,…
- 调用摄像头
- 调用摄像头
- IOS调用摄像头或照片库获取资源
- cocos2d-x 调用iOS摄像头 c++ 和 OC混编
- iOS 调用相册或摄像头后状态栏消失解决办法
- iOS开发 调用摄像头拍照按钮中文设置
- Unity3D调用iOS摄像头全屏旋转,ZXing测试
- iOS-Core-Animation-Advanced-Techniques(三)
- CSS让div层悬浮在最上方
- spring读取资源文件
- 什么是I帧,P帧,B帧
- LeetCode_45---Jump Game II
- IOS 调用摄像头
- Linux_4.8_共享内存通信
- Activiti部署流程报错
- 如何建立落地型数据分析(挖掘)流程
- showDialog()、onPrepareDialog()和onCreateDialog()的关系 .
- #leetcode#Course Schedule II
- Go图片上传
- Hnadler的基本使用
- Linux下串口编程入门