Hi guy,
I want to create an UIImage of UIWebView and then I want to draw that image.
Here is my code:
UIWebView *tempView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 44, 700, 1024)];
[webView loadHTMLString:@"Display This String" baseURL:nil];
UIGraphicsBeginImageContext(tempView.bounds.size);
[tempView drawRect:tempView.bounds];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
CGRect imageRect = CGRectMake(0, 0, image.size.width, image.size.height);
CGContextDrawImage(ctx, imageRect, [image CGImage]);
but its not drawing anything other than a blank page. Cant we create UIImage like that or Am I doing something wrong somewhere in the code.
Thanx