Closed flovouin closed 7 years ago
Hi @Adlai-Holler
I still have the problem in my app, however I was unable to reproduce the issue in a simple sample app. As mentioned above, I am trying to take a screenshot of the whole window. This window contains regular ASDisplayNode
s, as well as an ASCollectionNode
with many GLKView
s.
I can confirm that taking a screenshot works with 016d99 and returns a blank (black?) image with 5b80a6 onwards.
To my knowledge, I do not make use of rasterization in my app.
Would you have any pointers on what I could check to find the issue and solve this?
Cheers,
Flo
Seeing the same issue.
public extension UIImage {
public convenience init(node: ASDisplayNode) {
UIGraphicsBeginImageContext(node.frame.size)
node.layer.renderInContext(UIGraphicsGetCurrentContext()!)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
self.init(CGImage: image!.CGImage!)
}
}
The ASImageNode and ASTextNode are missing, but ASDiplayNode's UIViews do show up in the screenshot. I'm only taking a screenshot of a select View/Node and its SubNodes.
Would someone be willing to upload a sample project? We're not seeing this issue and we do a similar thing in Pinterest when reporting bugs.
Hi @garrettmoon ,
As I said in my previous comment, I was unable to reproduce the issue in a simple test project, and there are too many possible causes in my app to try. Also, I'm not sure where it could come from, as I'm not an expert on what's been changed recently in ASDK.
I can confirm that commit 5b80a6
introduces the issue, as exactly the same code works with previous commits. That's why I'm asking for pointers on things I could try out to debug this.
Cheers,
Okay, a follow up on this: I found the change out of luck, by working on something else. In my case it wasn't related to taking a screenshot.
The thing is, I am using a UIVisualEffectView
on top of the screenshot (which is displayed in an ASImageNode
). The problem is that creating an ASDisplayNode
by passing the effect view in the viewBlock
is no longer sufficient. I also had to set the node background colour to clear, otherwise I get a black background.
So as far as I'm concerned the issue can be closed. But it seems that @rankinit problem is different, so I'll let him reply if needed.
Thanks @flovouin sorry for not following up with you sooner on this. @rankinit if you're still hitting this issue would you mind putting up a standalone sample project for us to take a look at?
Hi guys,
As mentioned on Slack, I discovered an issue while trying to upgrade from
4355f4d
to2.0
. I just tried onmaster
(ab5627
) and the problem is still here. There is a great probability that this was introduced in5b80a6
.The issue is that taking a screenshot of a view (the main window actually) no longer works and returns a black image. To take the screenshot I use a (popular?) piece of code found around the interwebs:
In my case,
view
is thekeyWindow
of thesharedApplication
. I take the screenshot on the main thread, in aviewDidLoad
of anASViewController
that appears short after.Using
4355f4d
, this works perfectly and returns the expected image.Please tell me if you need more details or a test project.
Cheers,
Flo