Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified
Accepted Solution

Bitmap Text Point

Hello guys'


I have little problem. This is : I created BitmapField then added to scree.


_bitmapScreen = new BitmapField();



Then load JPG image to BitmapField. It is working. 


Bitmap bitmap = createImage(data);


data  is byte massive : byte[] data;


Graphics graphics = new Graphics(bitmap);

int xOffset = (logo.getWidth() - Font.getDefault().getAdvance(logoString)) / 2;

int yOffset = (logo.getHeight() - Font.getDefault().getHeight()) / 2;


graphics.drawText("TEXT" xOffset, yOffset);


Finally :

  _mapScreen._bitmapScreen.setBitmap(bitmap); this line doesn't work right?


 I think print text "TEXT" on bitmapField. But it didnt draw text.


Is there any solution ? guys




Posts: 249
Registered: ‎07-14-2008
My Device: Not Specified

Re: Bitmap Text Point

Looks like a UI sync problem to me. As far as I understand this case, the image data for the BitmapField is updated but the BitmapField is not painted with the image.


Can you try to enclose the code below in an invokeLater() call? This method is defined in the UiApplication class. Please refer to the javadocs of UiApplication for more information.


BlackBerry Development Advisor
Posts: 15,874
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Bitmap Text Point

Also note that you may need to call BitmapField.invalidate.  This causes the field to be redrawn.


Depending on where you call this from, you may need to wrap it as shaque described.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified

Re: Bitmap Text Point

Tnx a lot' guys' I found my mistake.