0

hope you will be doing fine.

I need to capture my View when I am in landscape orientation.

I am capturing gently in Portrait orientation, but when I switch to landscape orientation then only half of image I could capture.

I am doing something like this

UIGraphicsBeginImageContext(self.view.frame.size);
        [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
        viewImage = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
        UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);

What should I do when I am in Landscape Orientation.

Thing to remember :: When I am in landscape I have contents in scroll View, and they are not shown until I scroll down.

Is it making problem (the scroll view)?

Thanks in anticipation.

iOmi
  • 625
  • 10
  • 24
  • You can detect current screen orientation state. So You need to pass the scrollview context when you are in landscape mode, as you are passing view's context currently in portrait mode. I hope it'll resolve your issue. Please let me know if it helps. – iCreative Dec 06 '12 at 12:15
  • I got the screen orientation and passed the scrollview context but again it returned me only half image (the image that I can see on the screen). Any way thanks for the answer. I have done it by adding the remaining items in the `UIGraphicContext` and the create image of it. – iOmi Dec 07 '12 at 07:12

0 Answers0