I want to do a screenshot of a UIWebView, I use this code
Code:
UIGraphicsBeginImageContext(self.vistaWeb.bounds.size);
[vistaWeb.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage,nil,NULL,NULL);
and it work well, my problem is that I want to make a screenshot of all the uiwebview, not only the visible view…for example, I have a uiwebview of 200×200 but the page is 200×500, whit this code I make a screenshot of 200×200 while I want to do a screenshot of 200×500.what I have to do?
kikko088
The problem is in the line:
You are using the size of your view and not the size of its content. In order to obtain the size of your page use the following approach. Then just replace
self.vistaWeb.bounds.sizewith an appropriate size.In order to support retina you should replace the first line of your code with the following: