JohnDoe4136
JohnDoe4136

Reputation: 539

Opening a image file - BLACKBERRY/J2ME

I am trying to open an image in blackberry.

I got this in python - myImage = graphics.Image.open(jobDirectory + "\" + name) and I wish to use this similar thing in Blackberry/ J2ME.

Upvotes: 0

Views: 823

Answers (1)

Harry Joy
Harry Joy

Reputation: 59650

In J2ME you can display image in following two ways:

Image image = Image.createImage(path_to_img+"/img.PNG");

g.drawImage(image, x, y, Graphics.TOP | Graphics.LEFT);   // 1) Use drawImage function.

Sprite mainSprite = new Sprite(image); // 2) Use Sprite to display your image.
mainSprite.setRefPixelPosition(x, y);
mainSprite.paint(g);

Hope this helps.

Upvotes: 4

Related Questions