Question regarding layer two bitmaps on top of each other, one of which is semi-transparent.
I have a custom UIView called foo. I have two CGBitmapContext's I have created. They are effectively being used as offscreen buffers and are of equal rectangular dimensions. I want to take the two of these offscreen and layer them one on top of the other. The background should be semi-transparent, the foreground should be opaque (but is using clearColor in order to show through the background). The effect is that you have a sharp foreground with visibility into a background image where the foreground is not painted (clearColor).
CGContextRef background;
CGContextRef foreground;
I am trying to implement this in the custom UIView foo where the two CGBitmapContext's reside. I have a parent view (background) with a subview (foreground), and I am trying to implement this in the (void) drawRect: (CGRect)rect override. I've tried jimmying this around repeatedly, but I usually can only get one of the views/bitmaps to show.
Question 1: Is this the right approach? Should I try to be using layers instead? Should I combine the bitmaps and then BLT to parent/root UIView? Quesiton 2: Any sample code that can be provided to accomplish the above is appreciated!
Thanks!