我正在尝试在contex中呈现/绘制snapshotView的UIView,以获得UIImage.then将其设置为CAlayer.contents。我尝试这个方法来获得snapshotView:
snapshotViewAfterScreenUpdates:
然后将UIView转换为UIImage:
UIGraphicsBeginImageContext(view.bounds.size);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
//I'm trying this method too
[view dr
我希望在我的CCGLView中对viewController中的内容进行快照,并在同一个viewController中显示结果图像。
现在,我正在使用以下方法来完成此操作:
-(UIImage *) drawableToCGImage{
GLint backingWidth2, backingHeight2;
//backingHeight2=self.glView.frame.size.height;
//backingWidth2=self.glView.frame.size.width;
//Bind the color renderbuffer used
当有硬件加速的内容(一些特定的赌场游戏运行在iframe内)时,我在拍摄WKWebview内容的屏幕截图时遇到了严重的问题。到目前为止,我按照每个人的建议,使用了截图的标准方式:
UIGraphicsBeginImageContextWithOptions(containerView.frame.size, true, 0.0)
containerView.layer.render(in: UIGraphicsGetCurrentContext()!)
//This line helps to fix view rendering for taking screenshot on olde
我找到了
func screenShotMethod() {
//Create the UIImage
UIGraphicsBeginImageContext(view.frame.size)
view.layer.renderInContext(UIGraphicsGetCurrentContext())
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
//Save it to the camera roll
UIIm