I have a little problem, with Android application:
I need to take a picture, but I need to put a transparent image over the camera display, like overlapped.
There are different ways, (but i don’t know how):
-
Using the the android camera
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri); intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1); activity.startActivityForResult(intent, Picture.CAMERA);for this, i should do anything like start this intent transparent, and my overlapped image be under.
-
Including the camera in my XML, and do the changes that I need, or something like this.
-
Download a source code of android camera from somewhere, change that like I need, and commercialize my application. (I don’t know if the license lets me do this).
-
Create my own camera (this will be ugly, and my last choice).
Good ideas are welcome.
Best Regards!
I’ve done this myself — at the time I couldn’t find anyone else that had. You can’t rely on the camera intent for this. The approach I would use is using a camera preview, which you can write in a class, then include in xml in a frame layout. In the same layout include a full screen image view. It takes some fiddling with zorder etc, especially when adding/removing the image.
Writing a class to control a camera preview might seem daunting, but is actually very straight forward, and gives you a lot more control than simply using the camera intent. See here for more information.