use of com.codename1.ui.TextSelection.Char in project CodeRAD by shannah.
the class FirstCharEntityImageRenderer method getLetter.
private Image getLetter(char c) {
c = Character.toUpperCase(c);
String cstr = "" + c;
com.codename1.ui.Label lbl = new com.codename1.ui.Label(cstr);
Image bg = getLetterBackground(c);
lbl.getStyle().setBgImage(bg);
lbl.getStyle().setBgTransparency(0x0);
lbl.getStyle().setBackgroundType(Style.BACKGROUND_IMAGE_ALIGNED_CENTER);
lbl.getStyle().setAlignment(CENTER);
lbl.getStyle().setFont(letterFont);
lbl.getStyle().setFgColor(0xffffff);
return new ComponentImage(lbl, bg.getWidth(), bg.getHeight());
}
Aggregations