I want to use a UILabel to create an RGBA stream of bytes image representation programmatically (at runtime).
For example, I want to create a UILabel in a specific
This should work:
UIGraphicsBeginImageContext(yourLabel.bounds.size);
[yourLabel.layer renderInContext:UIGraphicsGetCurrentContext()];
CGImageRef viewImage = [UIGraphicsGetImageFromCurrentImageContext() CGImage];
UIGraphicsEndImageContext();
UIGraphicsGetImageFromCurrentImageContext()
returns an instance of UIImage
.