I am using the CWAC camera library in my application. I tried this and this is working fine showing the camera preview in the relevent Fregment.
Now all I want to past a picture on that camera preview and whenever I click button to take picture it should take picture with that image. I want image in forground and the camera preview in background of it . So is there any way to do that . Here is the sample code that I am using to take picture
This has nothing to do with the CWAC-Camera library. If you want to merge multiple image files together, you are welcome to do so, but you would do that after taking the picture.
Related
I am doing a simple application using Camera android and noticed that when a take a picture, the preview camera image is a little smaller than the final picture. What am I doing wrong?
attached example images from the app:
I am trying to create a custom camera application. I am using textureView with Camera2 api. But when I am opening the application, only black screen is shown. When I click on "click picture" button It captures proper image and screen again goes black. I need to get proper image preview in place of black screen.
You give very less information, but you can have a look at this example:
https://github.com/googlesamples/android-Camera2Basic
In the example there is also used a TextureView.
I want to capture a particular area from the camera.
I can build the custom preview, but that is not my actual requirement.
i want to have viewfinder like capture area on camera view and that should be the captured image size.
I was trying to do this a month back. The captured image or the preview image will not be pre-cropped. The trick is to identify your viewfinders rect and apply crop on the captured image.
You can head over to GitHub and clone my project Shaili-Android.
You will find the relevant camera code in CameraActivity.java
I have documented the project religiously. If you have issues, comment below.
Hope this helps :)
I have a surface view, 3 buttons one each for capture, use(invisible) and retake(invisible). I am using the Camera to take a picture. On image capture, use and retake buttons become visible and capture goes invisible. How to save the image in SD card on clicking the use button. Can anyone help with any example code. ??
Inshort I dont want to skip retake and skip option after capturing a pic in android !!! No use of intents !! only using android camera
How to skip 'retake and use' option after captureing photo from camera
Here is a nice tutorial on taking picture in Android: http://www.vogella.com/tutorials/AndroidCamera/article.html
In the nutshell, after you call Camera.takePicture(), a onPictureTaken() callback is called with jpeg image in byte[]. You convert this image to bitmap (preferably scaled down) for display, and you can write this byte[] as is to a .jpg file if the user likes it.
I am developing an app which uses surface.callback to initialize the front camera when the app is started. I have done overlayering on the camera and added some buttons along with some funny images.
Now there are three ways to do this as far as my knowledge goes (and I am a newbie so if there's another method that would also be appreciable.)
Capture image: The problem is that if I capture the image from
camera, I won't get the funny images which are added on the top of
the camera preview.
Screenshot: As I have done this through overlayering, hence taking a
screenshot through code of a selected portion isn't yielding any
result also. Because it only takes the screenshot of the layer with
buttons and funny image but not the screenshot of the camera preview
as it is behind the layout containing above mentioned items.
Now the only resort is that I merge two images. One from my drawables
folder (funny images) and second obtained at runtime from front
camera.
Anyone who can kindly help me merge two images. I have seen some tutorials/codes but they take both images from drawables folder while my second image is obtained at runtime through camera.
You can capture the camera image and edit it (overlay with funny images) before writing it to file.