iphone/ipad application - taking screen shot

Posted by satyam on Stack Overflow See other posts from Stack Overflow or by satyam
Published on 2010-05-14T02:50:08Z Indexed on 2010/05/14 2:54 UTC
Read the original article Hit count: 290

Filed under:
|
|
|

I successfully implemented an application that works on ipad as well as on iphone. In that I provided option to user to send the screen shot of the application as mail attachment. Even that is functioning well. But my code is taking screen shot irrespective of orientation. The image i'm getting is always in portrait mode. I want to take the screen shot depending on the orientation of ipad/iphone and send the image as attachment. I'm using following code to take the screen shot.

UIGraphicsBeginImageContext(screenWindow.frame.size);
[screenWindow.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

© Stack Overflow or respective owner

Related posts about iphone

Related posts about ipad