0

画像間の遷移のスクリーンショットをキャプチャしたい。

- (UIImage *)captureView:(UIView *)view
{
    CGRect screenRect = [[UIScreen mainScreen] bounds];
    UIGraphicsBeginImageContext(screenRect.size);
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    [[UIColor blackColor] set];
    CGContextFillRect(ctx, screenRect);
    [view.layer.presentationLayer renderInContext:ctx];
    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return newImage;
}

UIImageView で画像のトランジションを再生しているときにこのメソッドを呼び出しますが、UIImageView で静止画像を取得しましたが、画像間のトランジションをキャプチャできません。誰でも私を助けることができますか?

4

1 に答える 1