Hi all,
I'm trying to simply place a static image on the screen. It presently has a black background which I would like to make transparent so you see just the graphic itself but I can't get 'color; '#0000' or '#00000000' to do the job.
I need this to work on both Android and iOS so I am not keen to use the iOS only APIs.
I'm guessing I'm doing something wrong. I am loading an image as a background image into either a view or imageView (neither work).
Should I be using blobs? Is there any documentation on these please as I can't find anything terribly helpful.
Can someone tell me what I need to do please?
1 Answer
Accepted Answer
I'm not sure what you're doing in your code to add an alpha channel to the image. You can't do that -- either the image has an alpha channel or it doesn't. JPEG files do not have alpha channels. You have to use a PNG.
This isn't like the days of GIF where you would designate one color as transparent. Each pixel in a PNG has R, G, B, and A components.
If you display a PNG with an alpha channel in an ImageView, the parent view's background will show through the transparent parts of the image they way you want.
You should load the image in question into an image editor and remove the black pixels, leaving transparency behind.
Your Answer
Think you can help? Login to answer this question!