Вот написал простой класс для этих целей
import javax.microedition.lcdui.*;
public class MyTileImage {
public Image TileImage;
public static Graphics g;
public int iWidth;
public int iHeight;
public int tWidth;
public int tHeight;
public int maxCountTiles;
public int rows;
public int cols;
public MyTileImage(Graphics _g, String fName, int TileWidth, int TileHeight){
g=_g;
try {
TileImage = Image.createImage(fName);
}
catch (Exception ex) {}
tWidth = TileWidth;
tHeight = TileHeight;
iWidth = TileImage.getWidth();
iHeight = TileImage.getHeight();
rows = iHeight/tHeight;
cols = iWidth/tWidth;
maxCountTiles = cols * rows;
}
public void DrawImage(int index, int x, int y, int style){
int row=index/cols;
int col=index%cols;
g.setClip(x, y, tWidth, tHeight);
g.drawImage(TileImage, x-(col)*tWidth, y-(row)*tHeight, style);
g.setClip(0,0,Game.displayWidth,Game.displayHeight);
}
public void Destroy(){
g=null;
TileImage=null;
}
}