I am trying to allow the user to specify the background color of a
ninepatch that is part of my res/drawble directory.  The modified
ninepatch will then be set as the background image for my widget.  I
realize that you cannot change the contents of res/drawble so I have to
write the image to temporary storage and then use setImageFromURI to
point at the modified ninepatch.

I cannot figure out, however, how to save the image.

I have the following code:

Drawable bg = this.getResources().getDrawable(R.drawable.appwidget_bg);
bg.mutate();
bg.setColorFilter( color, PorterDuff.Mode.MULTIPLY );

What method can I now use to write this out?  There do not seem to be
any methods on Drawable that will persist an image.  Is there a helper
class that I need to use?  I did look at BitmapFactory but, unless I
misunderstood, it didn't seem to be the solution.

Is there a preferred location to use for this kind of temporary file?

Is there a better recommended way of doing what I am trying to do?

-- 
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