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;
}
It’s a little unclear what you are asking. But I think you want to render a webview into this image.
So assuming the web view is assigned to an instance variable like
webView, then you can simply replaceself.viewwithwebView.