FaceCamViewer显示实时摄像头窗口
FaceCamViewer 显示一个实时的摄像头窗口,类似 FaceTime。
环境配置
- AVFoundation.framework
- QuartzCore.framework
用法
将 FaceCamViewer.h 和 FaceCamViewer.m 复制到您的项目中。
导入#import "FaceCamViewer.h"
要显示相机源的位置。
基本实现:
FaceCamViewer * viewer = [[ FaceCamViewer alloc ] initWithDeviceType:IPHONE3x5 ]; [viewer startFaceCam]; [ self .view addSubview: viewer];
带有选项的实施:
FaceCamViewer * viewer3 = [[ FaceCamViewer alloc] initWithFrame:方法CGRectMake(190,290,120,160)];
viewer3.cameraType = AVCaptureDevicePositionBack ;
AVCaptureSession * session = [[ AVCaptureSession alloc] init];
viewer3.session = session;
viewer3.draggable = YES ;
[viewer3 startFaceCam];
[ self .view addSubview: viewer3];
选件
initWithDeviceType-设置预定的摄像机视框
- IPHONE3x5
- IPHONE4
- IPAD
摄像头类型(可选)
- AVCaptureDevicePositionFront(默认前置)
- AVCaptureDevicePositionBack
session(可选)- 设置 AVCaptureSession
可拖动的(可选)- 允许视图可拖动
评论