[android-developers] Resource ID

2010-09-06 Thread perumal316
Hi All,

I am using the function decodeResource(Resources res, int id,
BitmapFactory.Options opt).

I am using it in the following way:

BitmapFactory.decodeResource(getResources(), R.drawable.image,opt);

My question is instead of using R.drawable.image which is an image in
res\drawable folder, I want to use a image from sdcard.

Is it possible? How to get the resource id of an image in the sdcard?

Thanks In Advance,
Perumal

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Resource ID

2010-09-06 Thread Mark Murphy
On Mon, Sep 6, 2010 at 5:47 AM, perumal316 perumal...@gmail.com wrote:
 I am using the function decodeResource(Resources res, int id,
 BitmapFactory.Options opt).

 I am using it in the following way:

 BitmapFactory.decodeResource(getResources(), R.drawable.image,opt);

 My question is instead of using R.drawable.image which is an image in
 res\drawable folder, I want to use a image from sdcard.

 Is it possible? How to get the resource id of an image in the sdcard?

Images on the SD card are not resources, and therefore do not have
resource IDs. Use decodeFile(), please.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Consulting: http://commonsware.com/consulting

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Resource ID Range?

2008-04-06 Thread jml307

I was curious what the range was for the integers assigned to
resources?  Specifically will -1 ever be a valid value for a
resource?  In my code, I am passing a resource ID into a method and
sometimes I don't have that ID so I want to provide a value that I can
check against and know not to use.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---