BradLarson / GPUImage

An open source iOS framework for GPU-based image and video processing
http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
BSD 3-Clause "New" or "Revised" License
20.2k stars 4.61k forks source link

The screen capture code is completely invalid for GPUImageView #2587

Closed 15130886370 closed 5 years ago

15130886370 commented 5 years ago

Hello, I can't intercept the image of GPUImageView with this code. Why is this? I can get a blank image, but I can't capture the image rendered by GPUImageVIew. < @IBOutlet private weak var renderView: GPUImageView!

public func capture() -> UIImage? { UIGraphicsBeginImageContextWithOptions(base.bounds.size, false, 0) base.layer.affineTransform() base.layer.render(in: UIGraphicsGetCurrentContext()!) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return image } renderView.capture()

zickc commented 5 years ago

call drawViewHierarchyInRect:afterScreenUpdates: ref: https://developer.apple.com/library/archive/qa/qa1817/_index.html