iOS录屏/自定义相机
錄制屏幕參考(錄制屏幕 UI元素)
使用AVFoudation
https://github.com/search?l=Objective-C&q=ScreenRecoder&type=Repositories&utf8
預覽錄制好的視頻
MPMoviePlayerViewController *theMovie =[[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:_path]];[self presentMoviePlayerViewControllerAnimated:theMovie];theMovie.moviePlayer.movieSourceType = MPMovieSourceTypeFile;[theMovie.moviePlayer play]
使用ReplayKit錄屏
https://github.com/topws/ScreenRecord
錄制 攝像頭(自定義相機)
http://www.jianshu.com/p/af531ec23c44
#pragma mark? 截屏拍照
-(UIImage *)viewSnapshot:(UIView *)view withInRect:(CGRect)rect{
? ? UIGraphicsBeginImageContext(view.bounds.size);
? ? [view.layer renderInContext:UIGraphicsGetCurrentContext()];
? ? UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
? ? UIGraphicsEndImageContext();
? ? image = [UIImage imageWithCGImage:CGImageCreateWithImageInRect(image.CGImage, rect)];
? ? return image;
?? ?
}
總結
以上是生活随笔為你收集整理的iOS录屏/自定义相机的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JAVA编程实战之编写小游戏-大球吃小球
- 下一篇: VC++实现简单HTTP服务器