title: y + height must be <= bitmap.height() in android
body: <p>I want to create a bitmap form another but for each try it's a crash, this the error message</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: y + height must be &lt;= bitmap.height()
                at android.graphics.Bitmap.createBitmap(Bitmap.java:557)
                at android.graphics.Bitmap.createBitmap(Bitmap.java:522)
                saveBitmap(GesturesActivity.java:166)</p>
  </blockquote>
  
  <p>This is where i try the creation :</p>
  
  <pre><code>public void saveBitmap(){
      Bitmap bitmapToSave = Bitmap.createBitmap(view.getWidth(),view.getHeight(), Bitmap.Config.ARGB_8888);
      Canvas canvas = new Canvas(bitmapToSave);
      view.draw(canvas);
  
      int width = bitmapToSave.getWidth();
      int height = bitmapToSave.getHeight();
      System.out.println("view : "+view.getWidth());
      System.out.println("view : "+view.getHeight());
      System.out.println("btmp Width : "+width);
      System.out.println("btmp Height : "+height);
  
      Bitmap result = Bitmap.createBitmap(bitmapToSave, 0, view.getTop(), view.getWidth(), view.getWidth());
      SaveImage(result);
  }
  </code></pre>
  
  <p>Thanks for your help :D</p>
  
  <p>This is my logcat :</p>
  
  <pre><code>&gt; System.out﹕ view : 480
  System.out﹕ view : 480
  System.out﹕ btmp Width : 480
  System.out﹕ btmp Height : 480
  </code></pre>