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: 16
Registered: ‎04-08-2011
My Device: Torch 9800
My Carrier: Vodaphone

Background scaling

Hi all,

How do I make a background to scale and fit the width of a screen?

I've done the following, which lets the background fit the width of the screen but it is not scaled so parts are cut out.

The background also repeats as I used USE_ALL_HEIGHT.


I just want a background image to scale to the width of the screen.


Please help...


public class newScreen extends MainScreen {
	Bitmap backgroundBitmap = Bitmap.getBitmapResource("background.png");

	Background bg = BackgroundFactory.createBitmapBackground(backgroundBitmap);
	public IntroStoryScreen() {
		VerticalFieldManager hfm = new VerticalFieldManager(
						| VerticalFieldManager.USE_ALL_WIDTH);


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

Re: Background scaling

Do a search in this forum (see Search box top right) on scale or scaling, there are many other Threads that discuss this sort of issue. 

Posts: 16
Registered: ‎04-08-2011
My Device: Torch 9800
My Carrier: Vodaphone

Re: Background scaling

Now that I've scaled the image to the display, the image is repeated vertically.

How can I overcome this?
Posts: 37
Registered: ‎07-26-2011
My Device: Non Blackberry User
My Carrier: Non Blackberry User

Re: Background scaling

try using Repeat_None 

property of Background class

1. Please press the kudos button (star icon) on the left side to thank the user that helped you.
2. Please mark posts as solved if you found a solution.
- Paresh Indulkar
(Game Programmer at Synqua Games)
(Developer of games - BBM Cricket with Friends & Word Poker with Friends Smiley Very Happy )