-(IBAction)printDisplay:(id)sender{
CGRect rect = CGRectMake(0.0,44.0,self.view.frame.size.width,self.view.frame.size.height);
NSValue *rectObj = [NSValue valueWithCGRect:rect];
CGRect rectRestored = [rectObj CGRectValue];
UIGraphicsBeginImageContext(CGSizeMake(rectRestored.size.width, rectRestored.size.height-44));
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
}
This is code for capture the image from the current screen.
Problem is that I don’t want to get the UIToolBar for the capture into the screen for that what to do. My application screenshot looks like this :

and after I take a screenshot of the image :

In short I want the remove the UIToolBar when the snap of the image.
Thanx in advance for spend your valuable time.
@samuel
if the image frame is starting from below the Toolbar, you can just set the rect starting from (0,44). If the image frame is starting from beneath the toolbar from (0.0) just set the
toolbarObject.hidden = YES;before taking the screenshot through graphicsContext and reset it back totoolbarObject.hidden = NO;afterwards.