title: Programmatically crop Android screen grab?
body: <p>I'm using the following (scavenged) code to take a 'screenshot' and <code>action_send</code> it. It's al lworking okay, the only problem is the image doesn't contain the status bar. I know why, I'm just not sure what to do about it. Is there any way I can crop the image programmatically, or set some kind of boundary before I make the <code>getDrawingCache()</code> call??</p>
  
  <p>Thanks in advance!</p>
  
  <pre><code>View v1 = findViewById(android.R.id.content).getRootView();
  v1.setDrawingCacheEnabled(true);
  Bitmap screenshot = Bitmap.createBitmap(v1.getDrawingCache());
  v1.setDrawingCacheEnabled(false);
  
  String path = Images.Media.insertImage(getContentResolver(), screenshot, "title", null);
  Uri screenshotUri = Uri.parse(path);
  
  Intent sharingIntent = new Intent(Intent.ACTION_SEND);
  sharingIntent.setType("image/png");
  sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
  
  startActivity(Intent.createChooser(sharingIntent, "Share image using"));
  </code></pre>