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

0

在模拟器中,您可以按 3 次 shift 来减慢动画速度,然后您也许可以捕捉到过渡。

于 2013-04-01T12:35:59.567 回答