I have a large image. This image has some text for user. So I must not resize the image to fit in the smaller screen. Image is much larger than device screen size. My intention is to draw the complete image in canvas without comprising size. I want to move image bit by bit upon user key event (left, right, up, down), something like scrolling.
I can draw an image in canvas by:-
g.drawImage(image, 0, 0, Graphics.TOP | Graphics.LEFT);
I don't know how to act according to key event to bring other parts of the images like scrolling.
I have seen many j2me games having such feature.
Where to look for this information?
You can use Pngcrush Its main purpose is to reduce the size of the PNG IDAT datastream by trying various compression levels and PNG filter methods.If size of width or length is very large and you intend draw it on canvas,after creating image,you can use drawRegion method of Graphics in paint method of canvas to draw desired piece of image on it.You can change drawed piece of image(for example when user press a key)by change parameters of drawRegion() method and repaint canvas:
Here,first time picture drawn from Coordinate(ix,iy) in canvas.