Like Tom said:
Create a bitmap, like in your example.

- Create a mutable bitmap that is a copy of your original (Bitmap.copy
(...)).
- Wrap a canvas around this new mutable bitmap (new Canvas(bmCopy))
- Just draw on this canvas.
- After each draw on this canvas, your bmCopy will be updated.

If you don't have an original bitmap, but an original Drawable
instead, get the width and height of the drawable and create a mutable
(but empty) bitmap from that:
- Create a mutable bitmap that is the size of your drawable:
Bitmap.createBitmap(width, heigh, config);
- Wrap a canvas around this new mutable bitmap (canvas = new Canvas
(bitmap))
- Draw your original Drawable on this canvas (origDrawable.draw
(canvas)).
- Just draw other stuff on this canvas.
- After each draw on this canvas, your bitmap will be updated.

On May 26, 12:37 pm, guruk <[email protected]> wrote:
> Hi Tom, thanks for your help
>
> do you mean something like that: (till now i did not worked)
>
>         Bitmap ob = BitmapFactory.decodeResource
> (resources,R.drawable.mydaysminipic_td);
>                                                 Bitmap obm = 
> Bitmap.createScaledBitmap(ob, 18, 18,false);
>                                                 Canvas canvas = new 
> Canvas(obm);
>                                                 BitmapDrawable bmd = new 
> BitmapDrawable(canvas);
>                                                 
> bmd.setColorFilter(0xff00ffff,Mode.SRC_ATOP);
>                                                 bmd.draw(canvas);
>                                                 Bitmap newbit;
>                                                 newbit=bmd.getBitmap();
>
> Really I came crazy with that. Finaly I just need the Solution for:
>
> I have a Drawable and I like that all set pixels in it get another
> Color and
> finaly to update my widget ... for that I have to options:
>
> updateViews.setImageViewBitmap(draws2[i + 10], newbit);  //thats what
> I try now with above code
>
> or i make it simple:  (but i miss a link)
> --
> Drawable dx = resources.getDrawable(R.drawable.mydaysminipic_ov);
> dx.setColorFilter(0xff00ff00, Mode.SRC_ATOP);
> updateViews.setImageViewResource(draws2[i + 10],
> R.drawable.mydaysminipic_pe);
> --
> but that does not work, because WHAT is the ID (int) of my created
> dx??
>
> Any Ideas to solve that. would be really great
>
> Thanks
> Chris
--~--~---------~--~----~------------~-------~--~----~
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