简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM