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
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified

Re: Adding Background image to the Manger

Have you tried with setting your main screen non scrollable.

 

 

public class TestScreen extends MainScreen
{
public TestScreen()
{
super(NO_VERTICAL_SCROLL);
///////////////////////////
//////////////////////////
}
}

 

Regards

Bikas

 

 

Developer
Posts: 207
Registered: ‎07-31-2009
My Device: Not Specified

Re: Adding Background image to the Manger

I am not sure what ur getting at or what difference that makes.. But will try that .

------------------------------------------------------------------------------------------------------------------------
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.
Developer
Posts: 207
Registered: ‎07-31-2009
My Device: Not Specified

Re: Adding Background image to the Manger

Nope.. It doesnt make any difference..

------------------------------------------------------------------------------------------------------------------------
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.
Developer
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified

Re: Adding Background image to the Manger

Can you post the code you are trying.

 

Regards

Bikas

Developer
Posts: 207
Registered: ‎07-31-2009
My Device: Not Specified

Re: Adding Background image to the Manger

 

 

private VerticalFieldManager mainVerticalManager;

mainVerticalManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL){

    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);

 }

};

 

 

From here i go on to add to more managers to the mainvertical manager like so :


secondHorizontalManager.add(secondVerticalManager);

mainVerticalManager.add(secondHorizontalManager);

 

------------------------------------------------------------------------------------------------------------------------
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.
Developer
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified

Re: Adding Background image to the Manger

Try something like below:

 

imageManager = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL)
{     
   protected void paintBackground(Graphics graphics)
   {  
            
     graphics.clear();
     graphics.drawBitmap(0, 0, 
              Display.getWidth(),backgroundBitmap.getHeight() , 
              _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);
   }
};
        
mainVerticalManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL 
                             | Manager.VERTICAL_SCROLLBAR)
{
   protected void sublayout( int maxWidth, int maxHeight )
   {
     int width = Display.getWidth();
     int height = backgroundBitmap.getHeight();        
     super.sublayout( width, height);
     setExtent( width, height);
   }
};
        
mainVerticalManager.add(secondHorizontalManager);
        
imageManager.add(mainVerticalManager);

this.add(imageManager);

 

 

Regards

Bikas

Developer
Posts: 207
Registered: ‎07-31-2009
My Device: Not Specified

Re: Adding Background image to the Manger

Nope .That does'nt work either..Smiley Sad

------------------------------------------------------------------------------------------------------------------------
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.
Developer
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified

Re: Adding Background image to the Manger

[ Edited ]

Is your backgroud image width/height is bigger that screen width/height.

Can you please explain the exact senario you are trying to achieve.

 

@Edit : deleted some unnecessary lines

 

Regards

Bikas

Developer
Posts: 207
Registered: ‎07-31-2009
My Device: Not Specified

Re: Adding Background image to the Manger

The image gets displayed partially from the top until the red line. 

 

screenimage.jpg

------------------------------------------------------------------------------------------------------------------------
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.
Developer
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified

Re: Adding Background image to the Manger

Sorry can't see the image.

I can only see a triangle type shape.

 

Regards

Bikas