There 're several ways to solve problem:
1) First one is for MIDP 2 devices.
Image myImage = Image.createRGBImage(byte[] data, int width, int height, boolean processAlpha);
Each element of data is pixel in 0xAARRGGBB format.
2) Second way.
To my opinion it is slow to initialize and ugly by nature
.
Code:
int[] data = {pixels array of width*height length};
Image myImage = Image.createImage(width, height);
Graphics g = myImage.getGraphics();
for(int y=0; y<height; y++){
for(int x=0; x<width; x++){
g.setColor(data[y*width+x]);
g.fillRect(x,y, 1,1);
}
}