BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 07-19-2008, 10:32 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2008
Model: 8820
PIN: N/A
Carrier: Airtel
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default setting Background image

Please Login to Remove!

Hi,

I want to add a background image to one of my screens. That screen contains, two ButtonFields and two ActiveAutoTextFields...

All I want is that , I want to add an Image at the background,and the fields on top of that... And after adding the image at the background, there should not be any problem in getting the focus to the fields...

Please let me know how to do that...
Offline  
Old 07-19-2008, 04:16 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Take a look at paintBackground() in the Screen class. You'll override this method and perform your background image painting here.
Offline  
Old 07-20-2008, 09:41 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2008
Model: 8820
PIN: N/A
Carrier: Airtel
Posts: 18
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
Thanks for the reply. I implemented the following code and was able to successfully add the background image:

Bitmap backgroundBitmap = Bitmap.getBitmapResource("background.png");

HorizontalFieldManager horizontalFieldManager = new
HorizontalFieldManager(HorizontalFieldManager.USE_ ALL_WIDTH |
HorizontalFieldManager.USE_ALL_HEIGHT){

//Override the paint method to draw the background image.
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(),
backgroundBitmap, 0, 0);
super.paint(graphics);
}
};

In the screen, I have ActiveAutoTextEditFieldcomponent. Initially, when the screen gets displayed, I can see the background image under the ActiveAutoTextEditField. But as I type into the ActiveAutoTextEditField, I get a white background within the Field.

I dont want background image to be shown on the ActiveAutoTextEditField, in the first place. I want it to have a white background as soon as the screen is launched.

Is ActiveAutoTextEditField transparent by default, because of which I face this problem?

Regards,
Flavian
Offline  
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

MSA Altair 0-100 PPM LCD Hydrogen Sulfide H2S Single-gas Detector 10092521
$39.99
MSA Altair  0-100 PPM LCD Hydrogen Sulfide H2S Single-gas Detector 10092521 pictureMSA ALTAIR Gas Detecto
$99.99
MSA ALTAIR Gas Detecto pictureMSA 10107603 ALTAIR® 4X Multi-Gas Detector – LEL, O2, CO, H2S BRAND NEW IN BOX
$685.0
MSA 10107603 ALTAIR® 4X Multi-Gas Detector – LEL, O2, CO, H2S BRAND NEW IN BOX pictureMSA Altair 5XIR MULTI-GAS DETECTOR LEL,O2,CO,H2S&SO2-MINT CONDITION
$1295.0
MSA Altair 5XIR MULTI-GAS DETECTOR LEL,O2,CO,H2S&SO2-MINT CONDITION pictureMSA ALTAIR 5X 10106727 SO2 REPLACEMENT SENSOR- N.I.B.
$500.0
MSA ALTAIR 5X 10106727 SO2 REPLACEMENT SENSOR- N.I.B. picture






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