kSBCanvas is a SBCanvas, which is a subclass of UIImageView. It has a few UIImageView subviews. It all renders great to the iPhone screen.
I need composite the kSBCanvas and its subviews to an imageview that I want to write to disk.
I do the following:
UIGraphicsBeginImageContext(kSBCanvas.bounds.size);
[kSBCanvas drawRect: [kSBCanvas bounds]];
UIImage *theImage=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
then get a PNG representation and write it to disk.
The kSBCanvas renders, but not the subview images. I checked, and kBCanvas has subviews. Do I have to call drawRect on the subviews explicitly? Easy enough, but it does not seem right.