Welcome!

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

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

Paint text on BitmapField

Hello again'

I have a little experience of BB development. I need to paint some text on BitmapField for my application.

Do u have any example code ? Plz help me guys. Have a nice day. 

 

Tnx'

 

Please use plain text.
Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: Paint text on BitmapField

String logoBitmap = "mobiyana.png"; String logoString = "mobiyana.com"; logo = Bitmap.getBitmapResource(logoBitmap); Graphics graphics = new Graphics(logo);

int xOffset = (logo.getWidth() - Font.getDefault().getAdvance(logoString)) / 2; int yOffset = (logo.getHeight() - Font.getDefault().getHeight()) / 2; graphics.setColor(Color.WHITE); graphics.drawText(logoString, xOffset, yOffset); add(new BitmapField(logo));

 

Please use plain text.
Developer
Raiden
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified

Re: Paint text on BitmapField

Tnx a lot man' cool
Please use plain text.