UIGraphicsBeginImageContext question in Objective C

Posted by Henry D'Andrea on Stack Overflow See other posts from Stack Overflow or by Henry D'Andrea
Published on 2010-05-26T22:48:45Z Indexed on 2010/05/26 23:01 UTC
Read the original article Hit count: 192

Filed under:
|
|

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;
}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c