Search in sources :

Example 1 with Bitmap

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);
}
Also used : Bitmap(net.rim.device.api.system.Bitmap) BitmapField(net.rim.device.api.ui.component.BitmapField)

Example 2 with Bitmap

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;
}
Also used : Graphics(net.rim.device.api.ui.Graphics) Bitmap(net.rim.device.api.system.Bitmap)

Example 3 with Bitmap

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;
}
Also used : Bitmap(net.rim.device.api.system.Bitmap)

Example 4 with Bitmap

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;
}
Also used : Bitmap(net.rim.device.api.system.Bitmap)

Example 5 with Bitmap

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;
}
Also used : Bitmap(net.rim.device.api.system.Bitmap)

Aggregations

Bitmap (net.rim.device.api.system.Bitmap)9 Graphics (net.rim.device.api.ui.Graphics)3 ImageManipulator (com.blackberry.toolkit.ui.images.ImageManipulator)1 BitmapField (net.rim.device.api.ui.component.BitmapField)1