0
 UIGraphicsBeginImageContext(self.bounds.size );
 [self.layer renderInContext:UIGraphicsGetCurrentContext()];
 UIImage *currentScreen = UIGraphicsGetImageFromCurrentImageContext();
 UIGraphicsEndImageContext();

ここでは、更新されたスクラッチパッドのスクリーンショットをスクラッチパッドで取得できませんが、私のスクリーンショットには表示されません![スクラッチパッドのスクリーンショット][1]

4

1 に答える 1

0

のスクリーンショットを撮ることを検討している場合は、このようなことを試してくださいUIView or UIImageView

 UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, 1.0);// Add your view / ScratchPadView whichever you want to take Snap
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];

    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    [[UIColor redColor] set];
    NSData *imgData =  UIImageJPEGRepresentation(image, 1.0);
    UIGraphicsEndImageContext();
于 2013-10-25T12:10:39.253 に答える