title: AS3 - make a new bitmapData with non integar width and height
body: <p>Hey guys hoping someone can help here.  I am cropping a bitmap image into tiles using the following function:</p>
  
  <pre><code>function crop( _x:Number, _y:Number, _width:Number, _height:Number, callingScope:MovieClip, displayObject:DisplayObject = null, pixelSnapping:Boolean = false):Bitmap
  {
      var cropArea:Rectangle = new Rectangle( 0, 0, _width, _height );
      var croppedBitmap:Bitmap;
  
      if(pixelSnapping == true)
      {
          croppedBitmap = new Bitmap( new BitmapData( _width, _height ), PixelSnapping.ALWAYS, true );
      }
      else
      {
          croppedBitmap = new Bitmap( new BitmapData( _width, _height ), PixelSnapping.NEVER, true );
      }
  
      croppedBitmap.bitmapData.draw( (displayObject!=null) ? displayObject : callingScope.stage, new Matrix(1, 0, 0, 1, -_x, -_y) , null, null, cropArea, true );
  
      return croppedBitmap;
  }
  </code></pre>
  
  <p>The width and height being passed in is a non integer value, for instance 18.75.  When the new BitmapData is created it always rounds down the value to an integer, since the arguments for BitmapData are typed as such.  In the case of my needs here, the width and height will not likely ever be integers.  Is there a way to create these bitmap pieces of another image at the exact width and height I need or can a new bitmapData only be created with integer values for height and width?</p>
  
  <p>Thanks for any insight.</p>
  
  <p>EDIT:  I realize you can't have a fraction of a pixel, but...   What I am trying to achieve is dividing an image into tiles.  I want the amount of tiles to be variable, say 4 rows by 4 columns, or 6 rows by 8 columns.  the division of an image into X number of parts results in widths and heights in most cases to be non integar values like 18.75 for example.  The goal is to divide an image up into tiles, and have that image appear, assembled seamlessly, above the source image, where I would then manipulate the individual tiles for various purposes (puzzle game, tiled animation to new scene, etc).  I need the image, when assembled from all the tile pieces, to be an exact copy of the original image, with no lines between tiles, or white edges anywhere, and I need this to happen with non integer widths and heights for the bitmapData pieces that comprise the tiles.  Does that makes sense?  O_o</p>