开发者

android transparent picture

do you 开发者_如何学Cknow how to make a certain part of a picture (jpg) semitransparent, like in the attached image?

android transparent picture


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜