title: How to save whole canvas as jpeg image in android canvas?
body: <p>I have drawn something on canvas and i want to save  this drawing as jpeg image in my storage . Following method i used for that and it saving image sign.jpg in my directory but its saving blank black image nothing drawn on it its size 14.49kb .</p>
  
  <p>Here is method for that</p>
  
  <pre><code>public Bitmap savebit(){
  
          Bitmap  saveBitmap = Bitmap.createBitmap(this.getWidth(), this.getHeight(), Bitmap.Config.ARGB_8888);
          Canvas canvas = new Canvas(saveBitmap);
          canvas.setBitmap(saveBitmap);
          this.draw(canvas);
  
          File file = new File(Environment.getExternalStorageDirectory() + "/sign.jpg");
  
          try {
              saveBitmap.compress(Bitmap.CompressFormat.JPEG, 100, new FileOutputStream(file));
          } catch (Exception e) {
              e.printStackTrace();
          }
          return saveBitmap;
      }
  </code></pre>