Hi, Wei,
Objects stored in the /res/drawable-* folders can be accessed by
loading the resource using the given static int in the R.drawable
class:
Bitmap mBitmap = BitmapFactory.decodeResource(getResources(),
R.drawable.pic1)
Note: it's best practice to ensure that the image is available for
all possible screen sizes or densities. As such, you should probably
put a copy of the image in drawable-ldpi and drawable-mdpi as well.
When you do this, Eclipse should automatically create an entry for you
in the R.drawable class.
If you need to reference the image in .xml (e.g. for building a
layout), then you can use "@drawable/pic1" or "@android:drawable/pic1"
depending on the context.
I hope this helps!
Best Regards,
Aaron M Brown
On Aug 7, 10:28 pm, wei oui <
wei17...@gmail.com> wrote:
> Hi,
>
> If I'm using imread("image", 1);
>
> then wat path should I put in image. I tried several time with different
> value but get force close when I run the application. I put the image under
> "/res/drawable-hdpi/" folder.
>
> thanks,
> wei.
>