2

I have an iOS app which allows the user to apply a series of 3D transforms before taking a screenshot which can be emailed or saved to the camera roll. This works great on screen, but the transforms get lost in the process of creating the image.

For example, when using the following transform:

double degrees = 10;
double radians = (degrees / 180) * M_PI;

CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity;
rotationAndPerspectiveTransform.m34 = 1.0 / -100;
rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, radians, 0.0f, 1.0f, 0.0f);

...it looks like this on the device: 3D Transform on screen

However, the resulting screenshot looks like this:

Screenshot taken from device

Note: I am taking the screenshot using the method recommended by Apple: http://developer.apple.com/library/ios/#qa/qa1703/_index.html#//apple_ref/doc/uid/DTS40010193

It doesn't look like UIGetScreenImage is an option given that it's a 'hidden' API, meaning that the app will probably get rejected.

Any suggestions would be much appreciated. If you're interested in taking a look then I have created a simple XCode project on Bitbucket: https://bitbucket.org/ian_tipton/3d-rotate-to-image

4

0 回答 0