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
Regular Contributor
Posts: 61
Registered: ‎05-22-2011
My Device: Blackberry Torch
My Carrier: Airtel
Accepted Solution

How to create a scalable background image?

Hello Everyone,

 

I would like to set a scalable background image to a label field. I set the backgound image with the help of setBackground() method available in label field. But when the text in the label field increases the background image tend to repeat rather than being scaled. Can someone please help me on this?

 

Thank you very much in advance. 

Jayakrishnan Salim

Developer
Posts: 19,624
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to create a scalable background image?

Never tried this myself, but have you reviewed the options when you create your Background? 

 

Have a look at this:

http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/ui/decor/BackgroundFactory.htm...

and review the

BackgroundFactory.createBitmapBackground(Bitmap, int, int, int)

parameters, specifically looking at setting REPEAT_SCALE_TO_FIT

 

Regular Contributor
Posts: 61
Registered: ‎05-22-2011
My Device: Blackberry Torch
My Carrier: Airtel

Re: How to create a scalable background image?

Thank you so much Peter. You are awesome!! :smileyhappy: