Getting Bitmap from drawable object

by Devin Yu » Wed, 14 Apr 2010 03:03:48 GMT


Sponsored Links
 Hi all,

I got a drawable object from Res ID. But I want to know its
coresponding bitmap file.
Any body can tell me how to do it?

Thanks.

--



Other Threads

1. Coloring Default Buttons - color filter only on unfocused state

Hi All,

I want to buttons of different colors, but I want to do so while using
the default button background resource in order to preserve the
onfocus and onclick states.  This is because I want to use the default
highlight color of the OS for my app, which is NOT always orange (HTC
Sense makes it green).

I found that adding a color filter to the button's background drawable
works great (in this case, blue):

myButton.getBackground().setColorFilter(Color.parseColor(this.getString
(R.color.button_blue)), Mode.MULTIPLY);

BUT, when the button is focused or clicked, it turns a {*filter*}
orange_blue because it mixes the color filter with the orange of the
background drawable.

I want to ONLY set this color filter for the unfocused/unclicked nine-
patch drawable within the default button's statelistdrawable.

I tried:

myButton.getBackground().getCurrent().setColorFilter(Color.parseColor
(this.getString(R.color.button_blue)), Mode.MULTIPLY);

But this does no coloring at all.  I'm not sure how else to do this.

Any help please?  Thanks very much!!

-- 

2. kickoff maps after clicking on address from browser or webview

I need to provide the users with an option to kick off the turn by
turn directions when they click on the address in my company's web
page.

I saw that the android devices already do this in some cases and I
would like to use this default feature provided by the OS. So please
let me know what is required for me as a developer do do either on my
app in the webview or on my server side code displaying the webpage in
order to let the device to kick off the maps app when user clicks on
the address.

It will also be nice to know if it is also possible to do the same
with phone numbers.

Thank you.

-- 

3. CyanogenMod-5.0-beta4 for Nexus One is out!

4. Current Status of Tethering Apps?

5. Questions on Graphics/Resolutions

6. DDMS GPS doesn't work: Send -120,35 loc = lm.getLastKnownLocation() returns null

7. Testing app on real device