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
Trusted Contributor
kirthiga
Posts: 204
Registered: ‎07-14-2010
My Device: 8100
My Carrier: Blackberry developer
Accepted Solution

add logo to my application

hi all ,

 

    i need to display an image as logo at the top pf my screen, and below that i should have the

listfield.

 i just need to know how to add image .

can anyone help ?

Please use plain text.
Developer
Ekansh
Posts: 468
Registered: ‎08-07-2009
My Device: Curve, Bold, Storm
My Carrier: Blackberry Developer

Re: add logo to my application

 

EncodedImage company_icon  = EncodedImage.getEncodedImageResource("front_logo.png");
        company_icon = Utility.ScaleImageToSize(company_icon,40,40);
        
        company_logo = new BitmapField(company_icon.getBitmap(), BitmapField.NON_FOCUSABLE);
        
        EncodedImage company_title  = EncodedImage.getEncodedImageResource("front_title.png");
        company_title = Utility.ScaleImageToSize(company_title,198,40);
        
        company_logoTitle = new BitmapField(company_title.getBitmap(), BitmapField.NON_FOCUSABLE);

        Company_icon_HFM = new HorizontalFieldManager()
        {
            protected void sublayout(int width,int height)
            {
                layoutChild(company_logo, getPreferredWidth(), getPreferredHeight());
                layoutChild(company_logoTitle, getPreferredWidth(), getPreferredHeight());
                setPositionChild(company_logo,0,(FieldSize.setY20-20));
                setPositionChild(company_logoTitle,40,(FieldSize.setY20-20));
                super.setExtent(width,FieldSize.setY40);   
            }
        };
        Company_icon_HFM.add(company_logo);
        Company_icon_HFM.add(company_logoTitle);

 

 

Hi,

 

You can to the above code.

 

and add above manager.

----------------------------------------------------------
feel free to press the kudos button on the left side to thank the user that helped you.
please mark posts as solved if you found a solution.
Please use plain text.
Contributor
yoshiegg
Posts: 22
Registered: ‎06-02-2010
My Device: 8330
My Carrier: Rogers & Bell

Re: add logo to my application

Add the logo.gif image to your project using Import.

 

 

then add this line to the Screen before adding other elements.

 

add(new BitmapField(Bitmap.getBitmapResource("logo.gif")));

Please use plain text.
Trusted Contributor
kirthiga
Posts: 204
Registered: ‎07-14-2010
My Device: 8100
My Carrier: Blackberry developer

Re: add logo to my application

[ Edited ]

thanks it worked ..  

Please use plain text.