The reason you get black images is to transfer and rotate calls back. Regular portrait images on the iPod / iphone are in the “correct” orientation. The correct code to convert them uses:
case UIImageOrientation.Right: case UIImageOrientation.RightMirrored: transform.Rotate (-(float)Math.PI / 2); transform.Translate (0, input.Size.Height); break;
Transformation functions are order dependent. This code rotates it in the correct orientation, but since the rotation around the 0,0 coordinate is in the lower left corner, the image is now very close to the bottom of the frame. the translation then pushes it to where it belongs.
The source code will push the side image from the top of the frame, then rotation will rotate everything so that the image will be rotated to the right, but to the right of the frame.
Using a small height value, such as 100 or 200 and pi / 4, you can easily see the differences that you get when you change the order of these functions, since part of the original image will always be visible.
source share