BlackBerry Forums Support Community               

Closed Thread
LinkBack Thread Tools
Old 07-21-2008, 09:22 AM   #1 (permalink)
Knows Where the Search Button Is
Join Date: Jul 2008
Model: 8820
Carrier: Airtel
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Background Image problem

Please Login to Remove!


I have a screen in which I have set a Background Image. The background Image has been added using the following code:-

mainVfm = new VerticalFieldManager(VerticalFieldManager.NO_VERTI CAL_SCROLL|VerticalFieldManager.NO_VERTICAL_SCROLL BAR|VerticalFieldManager.USE_ALL_WIDTH){
protected void sublayout(int maxWidth, int maxHeight){
super.sublayout(maxWidth, maxHeight);
setExtent(Display.getWidth(), Display.getHeight());
public void paint(Graphics graphics)

//Draw the background image and then call super.paint
//to paint the rest of the screen.
graphics.drawBitmap(0, 0, graphics.getScreenWidth(), graphics.getScreenHeight(),bckground, 0, 0);
graphics.drawBitmap(20, 10, graphics.getScreenWidth(), graphics.getScreenHeight(),logo, 0, 0);
// graphics.setGlobalAlpha(0);

The problem is that, in simulator 8100, the Image covers the entire screen,
but in 8300 simulator, it does not cover the entire screen as the 8300 screen is wider.

How to solve the problem, so that the background Image is displayed the same, covering the entire screen, in all the simulators?


Old 07-21-2008, 09:53 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
Join Date: Apr 2008
Location: Germany, BW
Model: -
Carrier: -
Posts: 310
Post Thanks: 0
Thanked 0 Times in 0 Posts

you have to provide a separate image fitting to the corresponding device's screen resolution.
Alternatively you could scale the image using EncodedImage class, but the result won't be the best since you will have to "damage" the aspect ratio.

Last edited by Ivanov : 07-21-2008 at 09:54 AM.
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

1PC NEW Omron Fiber Optic Amplifier Photoelectric Sensor E3X-NM11
1PC NEW Omron Fiber Optic Amplifier Photoelectric Sensor E3X-NM11 pictureFanuc A06B-6085-H103 Servo Amplifier
Fanuc A06B-6085-H103 Servo Amplifier pictureFanuc A06B-6066-H008 Servo Amplifier
Fanuc A06B-6066-H008  Servo Amplifier pictureFanuc A06B-6066-H004 Servo Amplifier
Fanuc A06B-6066-H004  Servo Amplifier pictureGould 57-1340-00 DC Amplifier 1/10V 5/15 Hz
Gould 57-1340-00 DC Amplifier 1/10V 5/15 Hz  picture

Copyright 2004-2016
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.