title: iPhone: how to take screen shots programmatically when using 3d layer transformations
body: <p>I am trying to programmatically save an image of the current view to a UIImage.
  the current view contains a background, and a number of UIImageViews that have had a 3d transformation applied to the layer, e.g.</p>
  
  <pre><code>CATransform3D t = CATransform3DIdentity;
  t = CATransform3DRotate(t, rotationX, 1.0, 0, 0);
  t = CATransform3DRotate(t, rotationY, 0, 1.0, 0);
  object.layer.transform = t;
  </code></pre>
  
  <p>I am currently grabbing a screenshot of the current view with the following code:</p>
  
  <pre><code>UIGraphicsBeginImageContext(background.bounds.size);
  [background.window.layer renderInContext:UIGraphicsGetCurrentContext()];
  UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsEndImageContext();
  </code></pre>
  
  <p>However, the 3d transformations on the objects are lost, e.g. the objects appear in the saved image as if no 3d transformations have been applied.  Is there a way to grab a screen shot programmatically that will include the 3d transformations?</p>
  
  <p>UIGetScreenImage() is not an option as that is a private API and this app is going to the app store.</p>