splitting an image into mutiple images
<p>I've searched the web for help and although it looked like a solution it turned out to not work so good. For starters I'd like to say I've just jumped into android programming (this is my first day) I really learn by trial and error I'd like it that if you could help me you'd give me hints rather than paste the code in front of me.</p>

<p>my tileset
<a href="http://img217.imageshack.us/img217/4654/tileseth.png" rel="nofollow">http://img217.imageshack.us/img217/4654/tileseth.png</a>
the result
<a href="http://img199.imageshack.us/img199/7913/resultx.png" rel="nofollow">http://img199.imageshack.us/img199/7913/resultx.png</a></p>

<p>the issues I'm having is 1. it is obviously not splitting the image in 32 by 32 bits. is what I'm trying to achieve is take my big image and split it into 9* smaller images of 32 by 32 portions. Secondary the image quality gets distorted and I can't work out why.
*I don't want to use a 9 patch as there will be more then 9 images soon just a fluke that atm I have 9 images</p>

<p>my code (evidently plagiarized from the internet)</p>

<pre><code>    tilesetSliced = Bitmap.createScaledBitmap(bmp, 96, 96, true);
    tileset[0] = Bitmap.createBitmap(tilesetSliced, 0, 0, 32, 32);
    tileset[1] = Bitmap.createBitmap(tilesetSliced, 32, 0, 32, 32);
    tileset[2] = Bitmap.createBitmap(tilesetSliced, 64, 0, 32, 32);
    tileset[3] = Bitmap.createBitmap(tilesetSliced, 0, 32, 32, 32);
    tileset[4] = Bitmap.createBitmap(tilesetSliced, 32, 32, 32, 32); 
    tileset[5] =  Bitmap.createBitmap(tilesetSliced, 64, 32, 32, 32);    
</code></pre>

<p>I'll make it more efficent once I got it working >.&lt; any help would be great</p>

<p>the on draw</p>

<pre><code>public void onDraw(Canvas canvas) {
  //update();
   for(int x=0; x&lt;= mapWidth; x++){
          for(int y = 0; y &lt;= mapHeight; y++){
                   canvas.drawBitmap(tileset[map[x][y]], x *32, y*32, null);
           }
     }
}
</code></pre>

<p>o.k some more debugging has shead light on something 1. I removed the scaledbitmap that stopped the quality being destroyed (orginally ahd it due to bugs) however I found out that for some reason it thinks the width of my tileset is 64 when its 96 any help would be nice on this.</p>
