android transparent picture
do you 开发者_如何学Cknow how to make a certain part of a picture (jpg) semitransparent, like in the attached image?
Just use a PNG image instead. Problem solved :)
JPEG doesn't support transparency. Can you use a 32-bit PNG instead?
If you have an existing image that you want to apply some transparency pattern to, you will need to create a Bitmap object in code, draw your image, then set some flags to allow you to draw the transparency levels over it, a bit like a Photoshop layer mask. I did a search for Android alpha masking, and found this blog post.
Err - I may be utterly confused here, but why not just use setAlpha(int alpha)
on the inflated ImageView?
That seems to work fine on a .jpg for me.
Or is it only part of the image that should be transparent? Hard to see the 'sample image'.
精彩评论