BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-21-2008, 09:22 AM   #1
flavian
Knows Where the Search Button Is
 
Join Date: Jul 2008
Model: 8820
PIN: N/A
Carrier: Airtel
Posts: 18
Default Background Image problem

Please Login to Remove!

Hi,

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.setColor(Color.WHITE);
// graphics.setGlobalAlpha(0);
super.paint(graphics);
}
};

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?

Regards,

Flavian
Offline  
Old 07-21-2008, 09:53 AM   #2
Ivanov
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Default

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..
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ picture

1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ

$317.00



MITSUBISHI FR-A820 1.5K TFA INVERTER A500 240 V #L-220 picture

MITSUBISHI FR-A820 1.5K TFA INVERTER A500 240 V #L-220

$684.00



1PC USED A54MA30B Mitsubishi F500/A500/A540 Series 30-37KW Mainboard #CZ picture

1PC USED A54MA30B Mitsubishi F500/A500/A540 Series 30-37KW Mainboard #CZ

$228.00



Padded Headset for Vocollect T2, T2X, T5, SR20T, A500 w/ Adjustable Mic picture

Padded Headset for Vocollect T2, T2X, T5, SR20T, A500 w/ Adjustable Mic

$133.88



1Pcs USED A500 7.5KW 380V FR-A540-7.5K-CH frequency converter picture

1Pcs USED A500 7.5KW 380V FR-A540-7.5K-CH frequency converter

$401.02



Mitsubishi FR-A540-0.75K-NA AC DRIVE INVERTER 1 HP 380-480 VAC 50/60 HZ 4.1 AMP  picture

Mitsubishi FR-A540-0.75K-NA AC DRIVE INVERTER 1 HP 380-480 VAC 50/60 HZ 4.1 AMP

$649.99







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