Figure on transparent background: Change the color?

by Markus » Tue, 10 Nov 2009 02:05:58 GMT

Sponsored Links
 Hello everybody

At the moment I've got an ImageView containing a PNG. This PNG has a
colored object with a transparent background. That works well.

However, now I'd like to be able to set the color of the object, but
STILL have a transparent background.

In case this is unclear, I've illustrated my problem: 

Could anyone tell how to accomplish that? A nudge in the right
direction would do :)

Thank you in advance.

Cheers, Markus


Other Threads

1. Question: How to guestimate the available bitmap memory on a device

Hi Dianne,

Thanks for your response.

I know that there is no real thing like bitmap memory.
But i also know that when i open a 12MByte bitmap (3MPixel, ARGB_8888)
i *always* get a OOM error. Even if i have more than 12MByte left to
work with, according to the heap dump.

I'm asking if there is a way to 'guesstimate' the amount available
that is left for opening (creating) bitmaps.


2. Another AbsoluteLayout deprecation question

> I believe I have politely and thoroughly stated my question.  Anyone

Everybody, even to an extent the core Android team folk on this list, is
contributing answers on a volunteer basis. Lots of questions get asked
here that do not get answered, for any number of reasons.

Also, bear in mind that you sent your question less than 24 hours ago. Not
everybody monitors this list continuously. If you need answers in that
short of a timeframe, hire a consultant.

I have watched your thread since its inception. I did not reply at first,
because you seemed set on having a core Android team member answer, and I
am not such a person. However, since your focus now seems to be on getting
some sort of answer from anyone, here's my take on it:

According to Ms. Hackborn's most recent(?) post on the topic, while
AbsoluteLayout is deprecated, it is not going away. Strategically, I
suppose that means no new code should be built that relies upon
AbsoluteLayout, but there is no need for a massive rush to the exits to
abandon AbsoluteLayout for existing code.

Personally, if I were in your shoes, I would aim to eliminate my
dependency on AbsoluteLayout in the next few months. Note that "eliminate
the dependency on AbsoluteLayout" could be simply a mental bookmark that,
should AbsoluteLayout ever be truly removed from the platform, that you
will be willing and able to maintain AbsoluteLayout yourself, based on the
last implementation found in the Android open source project.

But, again, Ms. Hackborn has indicated AbsoluteLayout is not going away,
and so you may elect to not worry about this issue in the near term.

I believe both of them, in related threads, indicated that the solution is
to create your own layout manager, rather than use AbsoluteLayout or
RelativeLayout or any of the other built-in ones.

Unfortunately, I am unaware of any tutorials on exactly how to do this.
You can probably examine the source of some of the existing layout
managers to see how they do what they do.

Mark Murphy (a Commons Guy)
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!


3. View object clonning

4. Is it faster to draw directly on a portrait or a landscape layout?

5. BBC mobile video streaming service

6. Android-Calendar, How to get first day of week?

7. About SD card mount option