If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
Contributor
Josimol
Posts: 28
Registered: ‎07-06-2011
My Device: 9800
My Carrier: blackberry developer trainee

Header and footer image

Hi,

 

 I have two images and i want to set both as my header and footer images for my app

How can i add

can anybody help me with sample code?

Please use plain text.
Super Contributor
pp
Posts: 278
Registered: ‎11-04-2010
My Device: 4.5 and above
My Carrier: none

Re: Header and footer image

Hi,

 

  Use BitmapField header = new BitmapField(Bitmap..getBitmapResource("header.png"),FIELD_HCENTER);

add this to main screen.

setTitle for header and setStatus for footer

see this ....

http://supportforums.blackberry.com/t5/Java-Development/MainScreen-explained/ta-p/606644

 

 

your header image should be in your project folder.

 

Thanks & Regards

             pp

Please use plain text.
Contributor
ksg1ajel
Posts: 46
Registered: ‎07-07-2011
My Device: 9800
My Carrier: BlackBerry

Re: Header and footer image

                      public void paint(Graphics graphics)
                          {   	
                           graphics.drawBitmap(0, 0, Display.getWidth(), Display.getHeight(), header, 0, 0);
                           graphics.drawBitmap(0, 0, Display.getWidth(), Display.getHeight(),footer, 0, 0);
                          super.paint(graphics);
                              
                          }      

 in the place of first zeros(0,0) give the positions where ever you want instead of zeros, the Last zeros simply ignore.

Please use plain text.