Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think you need to add the your UIImageView and your UILabel as a subview of a particular UIView (Suppose we call this view as <code>customView</code>) and then take the screenshot of the view using</p> <p><a href="https://stackoverflow.com/questions/3610604/how-to-take-a-screenshot-of-the-iphone-programmatically">how to take a screenshot of the iPhone programmatically?</a></p> <p><strong>Answer from the link modified to make it more easy for your understanding which is as follows:</strong></p> <p><strong>Important:</strong> Add <code>QuartzCore Framework</code> and add <code>#import&lt;QuartzCore/QuartzCore.h&gt;</code></p> <blockquote> <pre><code>CGSize screenSize = [[UIScreen mainScreen] applicationFrame].size; CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); CGContextRef ctx = CGBitmapContextCreate(nil, screenSize.width, screenSize.height, 8, 4*(int)screenSize.width, colorSpaceRef, kCGImageAlphaPremultipliedLast); CGContextTranslateCTM(ctx, 0.0, screenSize.height); CGContextScaleCTM(ctx, 1.0, -1.0); [(CALayer*)customView.layer renderInContext:ctx]; CGImageRef cgImage = CGBitmapContextCreateImage(ctx); UIImage *image = [UIImage imageWithCGImage:cgImage]; CGImageRelease(cgImage); CGContextRelease(ctx); [UIImageJPEGRepresentation(image, 1.0) writeToFile:filePath atomically:NO]; </code></pre> <p>Here <strong>filePath</strong> is your application's Documents directory file path.</p> </blockquote> <p><strong>You can get your NSDocuments Directory file path using:</strong></p> <pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"savedImage.png"]; </code></pre> <p>Now execute this code on any button or other control click you want the view to be captured.</p> <p>Let me know if you need more help.</p> <p>Hope this helps you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload