use of net.rim.device.api.system.Bitmap in project Samples-for-Java by blackberry.
the class Banner method addIcon.
/**
* Add an icon using the Bitmap. Will scale the image if it is larger than
* the space available.
*
* @param icon
*/
public void addIcon(Bitmap icon) {
if (icon == null) {
return;
// TODO does the API throw an Exception?
}
// Scale to same height as the other elements.
Bitmap image = scaleImage(icon);
if (this.icon != null) {
this.icon.setBitmap(image);
} else {
this.icon = new BitmapField(image);
}
add(this.icon);
}
use of net.rim.device.api.system.Bitmap in project Samples-for-Java by blackberry.
the class BitmapFactory method addStateIndicator.
public static Bitmap addStateIndicator(Bitmap unfocused_bmp, int color) {
int width = unfocused_bmp.getWidth();
int height = unfocused_bmp.getHeight();
int[] argb = new int[width * height];
unfocused_bmp.getARGB(argb, 0, width, 0, 0, width, height);
Bitmap new_bmp = new Bitmap(width, height);
new_bmp.setARGB(argb, 0, width, 0, 0, width, height);
Graphics pen = Graphics.create(new_bmp);
pen.setGlobalAlpha(Constants.TRANSPARENCY);
pen.setColor(color);
pen.fillRect(0, 0, width, height);
return new_bmp;
}
use of net.rim.device.api.system.Bitmap in project Samples-for-Java by blackberry.
the class BitmapFactory method getCrossUnfocused.
public static Bitmap getCrossUnfocused() {
int width = Display.getWidth();
int height = Display.getHeight();
UiConfig uiconfig = UiConfigFactory.getUiConfig(width, height);
Bitmap cross_unfocused = Bitmap.getBitmapResource(uiconfig.getTileNameCrossUnfocus());
return cross_unfocused;
}
use of net.rim.device.api.system.Bitmap in project Samples-for-Java by blackberry.
the class BitmapFactory method getBlankUnfocused.
public static Bitmap getBlankUnfocused() {
int width = Display.getWidth();
int height = Display.getHeight();
UiConfig uiconfig = UiConfigFactory.getUiConfig(width, height);
Bitmap blank_unfocused = Bitmap.getBitmapResource(uiconfig.getTileNameBlankUnfocus());
return blank_unfocused;
}
use of net.rim.device.api.system.Bitmap in project Samples-for-Java by blackberry.
the class BitmapFactory method getNoughtUnfocused.
public static Bitmap getNoughtUnfocused() {
int width = Display.getWidth();
int height = Display.getHeight();
UiConfig uiconfig = UiConfigFactory.getUiConfig(width, height);
Bitmap nought_unfocused = Bitmap.getBitmapResource(uiconfig.getTileNameNoughtUnfocus());
return nought_unfocused;
}
Aggregations