title: Android webview screenshot white border
body: <p>i followed this link to screenshot my webview completely. It works fine.
  But I have an issue. The screenhot that I get from the webview contains white spaces on the top and bottom of the picture? How do I get rid of this? Kindly let me know.</p>
  
  <p>This is the code that I've used for capturing from webview. IF YOU LOOK PROPERLY THERE IS WHITESPACE BOTH AT THE BOTTOM AND TOP PARTS OF THE IMAGE.</p>
  
  <pre><code>    public static String saveCapturedImageToSdCard() {
  
  
          Picture picture = WebViewActivity.sWebViewEx.capturePicture();
          Bitmap  b = Bitmap.createBitmap( picture.getWidth(),
          picture.getHeight(), Bitmap.Config.ARGB_8888);
          File file = null;
          Canvas c = new Canvas( b );
  
          picture.draw( c );
  //        FileOutputStream fos = null;
          try {
              file = new File(Environment.getExternalStorageDirectory()+"/"+"temp.png");
              if(file != null &amp;&amp; !file.exists())
                  file.createNewFile();
              // write the bytes in file
              FileOutputStream fos = new FileOutputStream(file);
              fos = new FileOutputStream(file);
                  if ( fos != null )
                  {
                      b.compress(Bitmap.CompressFormat.PNG, 100, fos);
  
                      fos.close();
                  }
              }
         catch( Exception e )
         {
  
         }
          return file.getPath().toString();
  }
  </code></pre>
  
  <p>This is the image that I get from the webview:</p>
  
  <p><img src="https://i.stack.imgur.com/6SbMy.jpg" alt="Screenshot image"></p>
  
  <p>My XML is:</p>
  
  <pre><code>&lt;WebView
          android:id="@+id/webview"
          android:layout_below="@id/linearlayout_topbuttons"
          android:layout_above="@id/gallery_webview"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" 
          android:overScrollMode="never"
          android:fitsSystemWindows="true"
          android:background="@android:color/transparent"
          android:layout_centerInParent="true"
          /&gt;
  </code></pre>