Android Question Adding Opaque Overlay on top of Camera Preview

walterf25

Expert
Licensed User
Longtime User
Hi All, i would like to find out if it would be possible to add an opaque overlay over the camera preview, i have seen some apps where they have a small rectangle in the middle where the camera preview looks normal and everything else around it looks as if it has an opaque overlay, please check the image below to see what i'm trying to accomplish, i would like to know if it would be possible to do something similar with B4A?

Screenshot_20190831-191119_Lightning QR.jpg

Any thought or ideas?

Thanks,
Walter
 

walterf25

Expert
Licensed User
Longtime User
Just add controls over the preview panel (not inside it).
Hi @Erel maybe i didn't make it too clear, i'm aware that i can add controls over the camera preview such as buttons etc, what i'm trying to accomplish and maybe is not too clear on the picture on my first post, what i 'm trying to do is add some type of overlay around the Preview with an alpha of maybe 75 to 100, i'm not sure if you can notice on the picture i have posted but there's a clear or transparent rectangle right in the middle and around that rectangle you see some sort of shade which is maybe around 75% transparent, that is the effect i'm trying to accomplish, don't pay attention to the small button in the middle with the + (Plus) sign.

Maybe this other image makes more sense, this is from a library wrapped by someone in the forums, as you may be able to see the clear rectangle in the middle and the shaded semi-transparent part around the rectangle which has a bluish color.

Screenshot_20190903-173333.jpg

Any ideas?
Walter
 
Upvote 0

Toky Olivier

Active Member
Licensed User
Longtime User
Why not make a picture with gimp or photoshop (or in runtime with BitampCreator) with the needed level of transparency with a fully transparent square in the middle? You can assign the picture to a ImageView on top of the Camera preview?
 
Upvote 0

syerif

Active Member
Licensed User
Longtime User
Hi @Erel maybe i didn't make it too clear, i'm aware that i can add controls over the camera preview such as buttons etc, what i'm trying to accomplish and maybe is not too clear on the picture on my first post, what i 'm trying to do is add some type of overlay around the Preview with an alpha of maybe 75 to 100, i'm not sure if you can notice on the picture i have posted but there's a clear or transparent rectangle right in the middle and around that rectangle you see some sort of shade which is maybe around 75% transparent, that is the effect i'm trying to accomplish, don't pay attention to the small button in the middle with the + (Plus) sign.

Maybe this other image makes more sense, this is from a library wrapped by someone in the forums, as you may be able to see the clear rectangle in the middle and the shaded semi-transparent part around the rectangle which has a bluish color.

View attachment 83617

Any ideas?
Walter
how you do this? any sample code please?
 
Upvote 0
Top