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
Developer
amsiddh
Posts: 142
Registered: ‎06-26-2009
My Device: Not Specified

Adding Background image to the Manger

i am trying to add the Background image to the VerticalFieldManger and adding it to the top of the screen as title or banner bez i want the hyperlink on that Background image.

 

For Ex:   logo.JPG

 

The following code is what m using

 

_backgroundBitmap = Bitmap.getBitmapResource("logo2.jpg");
          titleManager = VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR)
          {
              protected void paintBackground(Graphics graphics)
               {  
                System.out.println("am in paintBackground");
                   
                   graphics.clear();
                   graphics.drawBitmap(0, 0, 480,71, _backgroundBitmap, 0, 0);                
                   super.paintBackground(graphics);
               }
          };

         add(titleManager);

         hManager.add(tab1);
          hManager.add(spacer1);
          hManager.add(tab2);
          hManager.add(spacer2);
          hManager.add(tab3);

         add(hManager);

  all other fields are getting added to the screen except the titleManager , please help me ...

 

 

Please use plain text.
Developer
bikas
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified

Re: Adding Background image to the Manger

Try with overriding sublayout() method inside the titleManager.

Something like:

 

titleManager = VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR)
{
protected void paintBackground(Graphics graphics)
{
graphics.clear();
graphics.drawBitmap(0, 0, 480,71, _backgroundBitmap, 0,
0);
super.paintBackground(graphics);
}
protected void sublayout( int maxWidth, int maxHeight )
{
int width = Display.getWidth();
int height = _backgroundBitmap.getHeight();
super.sublayout( width, height);
setExtent( width, height);
}
};

 

Regards

Bikas

Please use plain text.
Developer
amsiddh
Posts: 142
Registered: ‎06-26-2009
My Device: Not Specified

Re: Adding Background image to the Manger

Hi Bikas,

 

It worked and i really  thanks to u.

 

Currently m working on project its UI is more related to the facebook appln.  if u  have any idea about the applications  like viigo, facebook and poynt specially abt UI development part, if you dont mind can u share some knowledge about these, are these application devlopers having there own apis and framework or BB apis are enough to devlope those applns(i dnt think BB apis are enough).

 

Is there any Tutorials are available on net which will help to devlop these applns and if you knw any special online training for BB or any CD,DVDs of training(Paid will also do) .

 

pls help me with this.....

 

Thanks,

 

Please use plain text.
Developer
belberry
Posts: 265
Registered: ‎08-27-2009
My Device: Not Specified

Re: Adding Background image to the Manger

Hi may i know the JDE which u r using the...and the which version of BlackBerry simulator u r creating for...
Please use plain text.
Developer
amsiddh
Posts: 142
Registered: ‎06-26-2009
My Device: Not Specified

Re: Adding Background image to the Manger

i am using JDE 4.5 and creating for simulators versions  4.5 and above....
Please use plain text.
Developer
belberry
Posts: 265
Registered: ‎08-27-2009
My Device: Not Specified

Re: Adding Background image to the Manger

can u pls tell were u ablt achieve ur task.....
Please use plain text.
Developer
belberry
Posts: 265
Registered: ‎08-27-2009
My Device: Not Specified

Re: Adding Background image to the Manger

I mean were u able to   add the Background image to the VerticalFieldManger and added it on the top of the screen as title......kindly provide the solution if u have this very interesting......
Please use plain text.
Developer
nirmalsat
Posts: 207
Registered: ‎07-31-2009
My Device: Not Specified

Re: Adding Background image to the Manger

Bikas's  code works perfectly.. I ve got one question though.. We got a picture in the manager as the background.. Now say we have a screen with say 4 different managers. What if we need one background image for the whole screen. How would we go abt it.. Would it work if instead of adding it to the manager , we add it to the screen ??

------------------------------------------------------------------------------------------------------------------------
Click the Kudos! badge on left side of the message , if you are happy with a solution given by a user. When you do so, you are saying thanks to its author.
Mark a reply as a solution , if you think your question has been answered.
To mark a message as a solution: Click "Accept as solution" icon on the reply.
Please use plain text.
Developer
Guest
Posts: 146
Registered: ‎11-05-2008
My Device: Not Specified

Re: Adding Background image to the Manger

In that case,what you can do ,take a VeticalFieldManager as Main Manager and call  paintbackground method and add all the 4 managers to it .

Please use plain text.
Developer
nirmalsat
Posts: 207
Registered: ‎07-31-2009
My Device: Not Specified

Re: Adding Background image to the Manger

[ Edited ]

Nope.. It doesnt work that way.. I tried. the rest of the image is not seen where the other managers have been added to the main vertical manager. Maybe if we could set some sort of transparency attribute to the other managers being added or something like that , but i dont thing there is anything of that type there.. 

 

 

Edit: And it doesnt work if we add it to the screen either...:smileysad:

------------------------------------------------------------------------------------------------------------------------
Click the Kudos! badge on left side of the message , if you are happy with a solution given by a user. When you do so, you are saying thanks to its author.
Mark a reply as a solution , if you think your question has been answered.
To mark a message as a solution: Click "Accept as solution" icon on the reply.
Please use plain text.