We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! I selected png and expected result like following.
But the result is that transparent area is filled with black. Would you please help me how i can solve this problem?
Regards, Adam.
The text was updated successfully, but these errors were encountered:
I have the same problem. Did someone figure it out?
Sorry, something went wrong.
My solution was:
extension UIImage {
func alphaPixelsData() -> [UInt8]? { let size = self.size let dataSize = size.width * size.height var pixelData = [UInt8](repeating: 0, count: Int(dataSize)) let colorSpace = CGColorSpaceCreateDeviceGray() let context = CGContext(data: &pixelData, width: Int(size.width), height: Int(size.height), bitsPerComponent: 8, bytesPerRow: Int(size.width), space: colorSpace, bitmapInfo: CGImageAlphaInfo.alphaOnly.rawValue) guard let cgImage = self.cgImage else { return nil } context?.draw(cgImage, in: CGRect(x: 0, y: 0, width: size.width, height: size.height)) return pixelData }
}
let maskView = TCMaskView(image: image) maskView.delegate = self if let alphaMaskArray = image.alphaPixelsData() { maskView.setInitialMaskWithArray(alphaMaskArray) } maskView.presentFrom(rootViewController: viewController, animated: true)
No branches or pull requests
Hi!
I selected png and expected result like following.
But the result is that transparent area is filled with black.
Would you please help me how i can solve this problem?
Regards,
Adam.
The text was updated successfully, but these errors were encountered: