How can I add a Fie开发者_Go百科ld that is just an image ? I;ve being try to override paint in LabelField but its not working -
import net.rim.device.api.system.EncodedImage;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.component.LabelField;
public class CustomLabelField extends LabelField{
private EncodedImage image;
public CustomLabelField (EncodedImage image){
super("",HCENTER | ELLIPSIS );
this.image = image;
}
public void paint(Graphics graphics){
graphics.drawImage(0, 0, image.getWidth(), image.getHeight(), image, 0, 0, 0);
}
Thanks
Have you tried using the BitmapField? If you only need an image this is the object to use.
精彩评论