07-18-2008 01:33 PM
Hello guys'
I have little problem. This is : I created BitmapField then added to scree.
------------------------------------------
_bitmapScreen = new BitmapField();
verMngr.add(_bitmapScreen);
horMngr.add(verMngr);
------------------------------------------
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.setColor(Color.WHITE);
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
tnx
Solved! Go to Solution.
07-18-2008 02:16 PM
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.
07-18-2008 02:26 PM
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.
07-18-2008 08:44 PM