I have a UIView
with a transparent background, and some buttons. I would like to capture the drawing of the view, shrink it, and redraw (mirror) it elsewhere on the screen. (On top of another view.) The buttons can change, so it isn't static.
What would be the best way to do this?
The general idea will be to get a
UIView
'slayer
to draw itself into a context and then grab aUIImage
out of it.You will also need to
#import <QuartzCore/QuartzCore.h>
If you don't really need to capture the drawing (from what you describe, it seems unlikely that you need an image), create another instance of the view and apply a transform. Something like...
I added the rotation just to show that you can do a variety of different things with transformations.
Check a nice sample code http://saveme-dot-txt.blogspot.com/2011/06/dynamic-view-reflection-using.html following WWDC sessions. It uses
for reflection, pretty easy to implement and looks really smooth and impressive.