3
我在玩MPMoviePlayerController.Perfectly時截屏,保存屏幕截圖,但圖像只有黑色。我使用下面的代碼。MPMoviePlayerController拍攝屏幕截圖,但只顯示黑屏
UIGraphicsBeginImageContext(self.moviePlayerController.view.frame.size);
[self.moviePlayerController.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
謝謝...但沒有任何反應UIGraphicsBeginImageContext(個體經營.moviePlayerController.view.frame.size); [self.moviePlayerController.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIGraphicsEndImageContext(); UIImage * aThumbnail = [self.moviePlayerController thumbnailImageAtTime:0 timeOption:MPMovieTimeOptionExact]; UIImageWriteToSavedPhotosAlbum(aThumbnail,nil,nil,nil);我用這條線。 –