Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何捕获Sprite Kit SKView的高质量快照图像?_Ios_Sprite Kit - Fatal编程技术网

Ios 如何捕获Sprite Kit SKView的高质量快照图像?

Ios 如何捕获Sprite Kit SKView的高质量快照图像?,ios,sprite-kit,Ios,Sprite Kit,我遵循将视图绘制为UIImage的传统方式: UIGraphicsBeginImageContextWithOptions(controller.skView.bounds.size, NO, 1.0); [controller.skView drawViewHierarchyInRect:controller.skView.bounds afterScreenUpdates:YES]; UIImage *viewImage = UIGraphicsGetImageFromCurrentIm

我遵循将视图绘制为UIImage的传统方式:

  UIGraphicsBeginImageContextWithOptions(controller.skView.bounds.size, NO, 1.0);
[controller.skView drawViewHierarchyInRect:controller.skView.bounds afterScreenUpdates:YES];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext(); 

我尝试将
UIGraphicsBeginImageContextWithOptions
中的第三个参数设置为2.0或更大,但是图像质量没有得到改善

在这里我发布了两张图片(第一张是通过代码捕获的,第二张是通过按下Home+电源按钮捕获的,系统支持此功能)


我想知道是否有办法让它变得更好。感谢您的帮助

UIGraphicsBeginImageContextWithOptions(controller.skView.bounds.size),很遗憾,它不起作用。@learncos2dwell它应该起作用@AndrewCarl@LearnCocos2D是的,再试一次,你是对的!