title: Issue implementing 9 Old Androids Flakes
body: <p>I'm a noob to android and I am trying to implement the 9 Old Androids flakes demo into my app.  However, when i change the the image resource from the image used by the demo to one of my choosing the app crashes and says IllegalArgumentException: width and height must be > 0.  My logcat says the line where I createscaledbitmap and createFlake is causing the issue.  I'm lost as why this is happening the demo image has a width of 75px x 90px and my image has a width of 166px x 72px.  Any help is greatly appreciated.</p>
  
  <p>FLAKE VIEW CLASS (Where i create Flake)</p>
  
  <pre><code>void addFlakes(int quantity) {
      for (int i = 0; i &lt; quantity; ++i) {
          flakes.add(Flake.createFlake(getWidth(), droid)); //This line causes exception
      }
      setNumFlakes(numFlakes + quantity);
  }
  
  /**
   * Subtract the specified number of droidflakes. We just take them off the end of the
   * list, leaving the others unchanged.
   */
  void subtractFlakes(int quantity) {
      for (int i = 0; i &lt; quantity; ++i) {
          int index = numFlakes - i - 1;
          flakes.remove(index);
      }
      setNumFlakes(numFlakes - quantity);
  }
  
  @Override
  protected void onSizeChanged(int w, int h, int oldw, int oldh) {
      super.onSizeChanged(w, h, oldw, oldh);
      // Reset list of droidflakes, then restart it with 8 flakes
      flakes.clear();
      numFlakes = 0;
      addFlakes(8); //This line causes exception
      // Cancel animator in case it was already running
      animator.cancel();
      // Set up fps tracking and start the animation
      startTime = System.currentTimeMillis();
      prevTime = startTime;
      frames = 0;
      animator.start();
  }
  </code></pre>
  
  <p>FLAKE CLASS (Where I create scaled bitmap)</p>
  
  <pre><code>static Flake createFlake(float xRange, Bitmap originalBitmap) {
      Flake flake = new Flake();
      // Size each flake with a width between 5 and 55 and a proportional height
      flake.width = (int)(5 + (float)Math.random() * 50);
      float hwRatio = originalBitmap.getHeight() / originalBitmap.getWidth();
      flake.height = (int)(flake.width * hwRatio);
  
      // Position the flake horizontally between the left and right of the range
      flake.x = (float)Math.random() * (xRange - flake.width);
      // Position the flake vertically slightly off the top of the display
      flake.y = 0 - (flake.height + (float)Math.random() * flake.height);
  
      // Each flake travels at 50-200 pixels per second
      flake.speed = 50 + (float) Math.random() * 150;
  
      // Flakes start at -90 to 90 degrees rotation, and rotate between -45 and 45
      // degrees per second
      flake.rotation = (float) Math.random() * 180 - 90;
      flake.rotationSpeed = (float) Math.random() * 90 - 45;
  
      // Get the cached bitmap for this size if it exists, otherwise create and cache one
      flake.bitmap = bitmapMap.get(flake.width);
      if (flake.bitmap == null) {
          flake.bitmap = Bitmap.createScaledBitmap(originalBitmap, //This line causes exception
                  (int)flake.width, (int)flake.height, true);
          bitmapMap.put(flake.width, flake.bitmap);
      }
      return flake;
  }
  </code></pre>