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
New Developer
Posts: 12
Registered: ‎01-12-2010
My Device: blackberry curve 8300
My Carrier: huh

Cant load images using eclipse.

Hi,

 

did anyone tried the tutorial on this site? http://na.blackberry.com/developers/resources/A11_User_Interface_V3.pdf

 

 

well i did and when i tried add the pictures at indicated in the tutorial they just wouldnt display properely (white blank page which is suppose to be the flag).

 

I tried resizing the pics and they are .pngs format.

 

additional information:

 

 

Eclipse Platform

Version: 3.4.1
Build id: M20080911-1700

 

Any help would be greatly appreciated Smiley Happy

New Developer
Posts: 12
Registered: ‎01-12-2010
My Device: blackberry curve 8300
My Carrier: huh

Re: Cant load images using eclipse.

bumpzzz Smiley Happy

 

can anyone shed some light?

New Developer
Posts: 65
Registered: ‎12-16-2009
My Device: Not Specified

Re: Cant load images using eclipse.

right click on the folder that the images are in and click "use as source folder" you might need to refresh the workspace too to get the new images loaded into eclipse

 

New Developer
Posts: 12
Registered: ‎01-12-2010
My Device: blackberry curve 8300
My Carrier: huh

Re: Cant load images using eclipse.

l tried already the problem is still the same.

 

 

the picture still does not display when i run the simulator Smiley Sad

 

New Developer
Posts: 12
Registered: ‎01-12-2010
My Device: blackberry curve 8300
My Carrier: huh

Re: Cant load images using eclipse.

bumpzzzzzzzz Smiley Happy

Developer
Posts: 193
Registered: ‎04-27-2009
My Device: Not Specified

Re: Cant load images using eclipse.

try following things:-

1)First check whether images are included in the project or not.if included then you can see those images in explorer view.

2)Open the images check whether they are opening in photshop correctly.

3)Check the path which you passed while creating bitmap,  also check the argument.

New Developer
Posts: 12
Registered: ‎01-12-2010
My Device: blackberry curve 8300
My Carrier: huh

Re: Cant load images using eclipse.

        _canadaImage = Bitmap.getBitmapResource("canada.png");
            _ukImage = Bitmap.getBitmapResource("uk.png");
            _usImage = Bitmap.getBitmapResource("us.png");
            _defaultImage = Bitmap.getBitmapResource("smile.png");

            _bitmap.setBitmap(_canadaImage);
         
            _fieldManagerTop.add(_bitmap);

 

 

here are my codes for the images part. I have checked the names and the format of the files are correct. I have gone into the folder itself and the pictures are not corrupted. I am still quite baffaled what could be wrong.

 

 

 

 

Developer
Posts: 193
Registered: ‎04-27-2009
My Device: Not Specified

Re: Cant load images using eclipse.

can you send me snapshot of package explorer view of your project .I want to see where is the images in your project.

you can also check whether canadaImage , _ukImage, _usImage ,  _defaultImage is null or not by putting conditions.

Developer
Posts: 265
Registered: ‎01-02-2011
My Device: Z30, PlayBook
My Carrier: AT&T

Re: Cant load images using eclipse.

I know this is an old thread, but maybe this will help others.  This worked for me.

 

 

When you create the Bitmap, do not put any directory struture in the resource string.

 

public static final Bitmap MY_LITTLE_IMG = Bitmap.getBitmapResource("mylittleimage.png");

 Place the images in a new Resources director under Res

 

My Project

> src

> res

 > >  resources

 > > > mylittleimage.png

_________________
Meetup for BlackBerry 10
Meetup Search Tool - not available at the moment