Worked out how to do this. I then used it to create a reflection
effect, for reference, and if anyone is interested, here's how to do
it:

http://www.inter-fuser.com/2009/12/android-reflections-with-bitmaps.html

On Dec 11, 12:49 pm, Taf <[email protected]> wrote:
> Hi,
>
> I'm trying to apply an Alpha gradient to a bitmap that I've created
> from a PNG. I want the image to be opaque at the top and fade to
> transparent at the bottom. I know this can be done be using getPixels
> and setPixels for Bitmap and iterating through each row of pixels in
> the Bitmap and setting the alpha values accordingly, but i was hoping
> there was a slightly neater way of doing this. I have been looking at
> the LinearGradient Class and using a Porter Duff transfer mode, but i
> don't seem to be having much luck with this. It seems that my source
> image is lost when i apply the Shader to the drawable.
>
> Anyone have any tips on how i might apply an alpha gradient to a
> bitmap?

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