You can get a drawable from the resources using:

context().getResources().getDrawable()



On Jun 21, 10:33 am, Jake Colman <[email protected]> wrote:
> Thanks for the help -- but now I realize that I don't know how to get
> the drawable!
>
> How do create a Drawable object from the drawable resource associated
> with my layout?  I am doing this within the context of a service and
> using a RemoteView.  If I had the modified Drawable, I believe I can use
> one of the 'set' methods available to me on the RemoteView to update the
> background image.  But how do I create the Drawable?  There does not
> seem to be a simple way to do via the resource ID.  Is there a way to
> create a file from the png in the drawable directory?
>
> ...Jake
>
> >>>>> "ZV" == Zsolt Vasvari <[email protected]> writes:
>
>    ZV> To color a B&W image, I use setColorFilter(color, Mode.MULTIPLY))
>    ZV> On Jun 20, 9:42 pm, Jake Colman <[email protected]> wrote:
>
>    >> Given that I have an integer value representing a color with an
>    >> included alpha (opacity) value, how do I set that value in a
>    >> drawable in order to change its background?
>    >>
>    >> The Drawable setColorFilter() method takes a color value and a
>    >> color filter. This method sounds promising since it accepts a
>    >> color value but But it's not clear to me how I should be setting
>    >> the ColorFilter value.
>    >>
>    >> Can anyone help?
>    >>
>    >> TIA!
>    >>
>    >> --
>    >> Jake Colman -- Android Tinkerer
>
>    ZV> --
>    ZV> You received this message because you are subscribed to the Google
>    ZV> Groups "Android Developers" group.
>    ZV> To post to this group, send email to 
> [email protected]
>    ZV> To unsubscribe from this group, send email to
>    ZV> [email protected]
>    ZV> For more options, visit this group at
>    ZV>http://groups.google.com/group/android-developers?hl=en
>
> --
> Jake Colman -- Android Tinkerer

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

Reply via email to