Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8408291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:35:31+00:00 2026-06-09T23:35:31+00:00

I tried to capture image from UIWebView using this method but the image contains

  • 0

I tried to capture image from UIWebView using this method but the image contains only visible area of the screen. How do I capture full content of UIWebView including invisible areas, i.e. the entire web page into one single image?

-(UIImage*)captureScreen:(UIView*) viewToCapture{
  UIGraphicsBeginImageContext(viewToCapture.bounds.size);
  [viewToCapture.layer renderInContext:UIGraphicsGetCurrentContext()];
  UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsEndImageContext();
  return viewImage;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T23:35:32+00:00Added an answer on June 9, 2026 at 11:35 pm

    EDIT (from a comment by Vad)

    Solution was to call

    webView.scalesPageToFit = YES;
    

    in the initialization, and

    [webView sizeToFit]
    

    when the page did finish loading.

    You are currently capturing only the visible part because you are limiting the image context to what’s visible. You should limit it to what’s available.

    UIView has a scrollView property that has contentSize, telling you what is the size of the web view inside the scroll view. You can use that size to set your image context like this:

    -(UIImage*)captureScreen:(UIView*) viewToCapture{
        CGSize overallSize = overallSize;
        UIGraphicsBeginImageContext(viewToCapture.scrollView.contentSize);
        // Save the current bounds
        CGRect tmp = viewToCapture.bounds;
        viewToCapture.bounds = CGRectMake(0, 0, overallSize.width, overallSize.height);
        // Wait for the view to finish loading.
        // This is not very nice, but it should work. A better approach would be
        // to use a delegate, and run the capturing on the did finish load event.
        while (viewToCapture.loading) {
             [NSThread sleepForTimeInterval:0.1];
        }
        [viewToCapture.layer renderInContext:UIGraphicsGetCurrentContext()];
        UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
        // Restore the bounds
        viewToCapture.bounds = tmp;
        return viewImage;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this code to capture the screen: public Bitmap CaptureWindow(IntPtr handle) { //
I've tried several techniques to capture a screenshot of an app from within that
I've been struggling to capture user input using JavaScript and jQuery . I've tried
tried uncommenting pam_limits.so from the pam.d directory but no luck. Basic PAM seems to
im having a hard time saving the image captured from the webcam using the
I would like to capture high resolution image with Windows Mobile device. I've tried
I am trying to capture image and video from my android application with the
I want to capture the browser window/tab close event. I have tried the following
Tried to create a mobile navigation using dataview or outline and the view renders
Tried searching the site, but cannot find an answer to my problem: Lets say

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.