【发布时间】:2015-05-11 06:15:20
【问题描述】:
我需要通过单击按钮获取视频的屏幕截图。下面是用于此的代码,但图像仅显示视频的底部部分,即随着时间的推移播放和进度..I已使用 MPMoviePlayerController 播放视频。
CGRect rect = [_moviePlayer.view bounds];
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[_moviePlayer.view.layer renderInContext:context];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 100, 100, 100)];
[imgView setImage:image];
imgView.layer.borderWidth = 2.0;
[_firstimage addSubview:imgView];
NSURL *url=[NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"];
这就是它的显示方式..我怎样才能获得视频图像?谁能帮帮我..
【问题讨论】:
-
@Rog 第二个链接帮助了......谢谢
标签: objective-c iphone