0

I just want to share a screen shoot of an UIView vie email, FB or what ever users want! The below code only takes a original of UIView with no inputed texts nor changed images

CGRect rect = [mainView bounds];
    UIGraphicsBeginImageContextWithOptions(rect.size,YES,0.0f);
    CGContextRef context = UIGraphicsGetCurrentContext();
    [mainView.layer renderInContext:context];
    UIImage *capturedImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
Breakpoint
  • 1,511
  • 1
  • 18
  • 41
gunhi
  • 5
  • 2
  • related: http://stackoverflow.com/questions/3869692/iphone-flattening-a-uiimageview-and-subviews-to-image-blank-image/3869804#3869804 – Antwan van Houdt Jan 20 '13 at 03:00

1 Answers1

0

You should be able to use one of the solutions at this answer depending on whether it's a retina device or not.

Community
  • 1
  • 1
Echilon
  • 10,064
  • 33
  • 131
  • 217