UIGraphicsBeginImageContext question in Objective C
- by Henry D'Andrea
I need the UIGraphicsBeginImageContext(self.view.frame.size); changed to where the .frame part pulls from webView
- (void) save {
UIGraphicsBeginImageContext(self.view.frame.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
NSLog(@"TEST");
}
WEBVIEW CODE:
-(BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)ntype {
NSLog(@"Scheme: %@", request.URL.scheme);
if ([request.URL.scheme isEqualToString:@"save"]) {
[self save];
}
return true;
}