Wednesday, January 16, 2008

Technical: MIDlet ImageItem

Display Image in MIDlet



We call the ImageItem constructor. It takes an Image object, a layout parameter and an alternate text string which is displayed if the device somehow unable to display the image. We did a test with png/gif/jpg.. guess what? despite it says only png is supported, our gif/jpg displays on the emulator device. 

Sample codes:

ImageItem img = new ImageItem( Image.createImage("../mac.png"), ImageItem.LAYOUT_CENTRE, "My Mac")

API here.  Also good explaination about it here.

Once alan is done with the captcha design picture generation, I will test it out. 

No comments:

Post a Comment