Overlapping Overlay Image with Image Taken from camera - android

I am doing a project where I need to OverLay few custom images, where option to add faces taken from camera will be given. Considering the following image
I will take faces from camera and I want to fit in the face into this overlay.
I have used following layout structure
FrameLayout
SurfaceView // For Displaying custom Camera
ImageView // For Displaying The overlay image as below
FrameLayout
I have zoom option for the ImageView as well which will make the image to fit in the Faces taken from camera
Now I am stuck in following 2 problems:
When I click on take picture, I am trying to get the drawing cache
of the Framelayout, But I am getting a black image for the
surfaceview view
Since I have ImageView to be zoomed as well, I am not able to
stitch back overlay to fit the face taken

Related

Overlaying, resizing and repositioning an image

Hey there I am developing an android app to add filters i am first getting the images from gallery and camera the i am overlaying another image in same image view but the problem is this that the image i overlayed is of fixed size. I want to resize and reposition it during run time. Watch this video for reference
https://youtu.be/kGbvO--RDwU
I just need your suggestions. I have overlayed the image perfectly. Now i just need to resize, repostion or rotate that image on run time

Android - I am using camera in a Texture View. I wish to add some kind of img or text on top of the live camera

I am using camera2 in a Texture View. I wish to add some kind of image or text on top of the live camera. for eg. the way snapchat adds the time or speed on top of the live View.
when i click a picture i want to capture the live camera image as well as the text or imageview on top of the camera.
I cannot seem to find any reference online
In theory if the base layout is a FrameLayout and then set the texture preview on the view with an index of 0, the rest of the components added after should now be on top.

CWAC2 capture only image visible in Preview

So, I've downloaded CWAC2 library and hacked it a bit so i can display a custom layout around the Preview of the camera.
The thing is that when I have the CameraFragment in preview mode inside a FrameLayout in my Activity (left side), i see one thing. After I take the picture (call the take appropriate method from the CameraFragment) and display the image inside an ImageView I see a "larger picture" (right side).
Is there to limit the camera to only capture what it displays on the Preview? I'm guessing I need to set the aspect ratio of the .... camera ?!
And no, it's not a matter of the left side being zoomed in.
As far as I understood, you would need to change what the CameraView is sending to your Frame Layout, so it's displaying the same thing as the camera is getting (your right pic).
Inside adjustAspectRatio() from the CameraView.java, try playing with the scaling of the view.
txform.setRectToRect(rectView, rectPreview, Matrix.ScaleToFit.START); // or Matrix.ScaleToFit.CENTER
float scale=Math.max((float)yourFrameLayoutHeight/rectPreview.height(), (float)yourFrameLayoutWidth/rectPreview.width());
txform.postScale(scale, scale, viewCenterX, viewCenterY);

How to take images only within the bounding box in android custom camera

Recently, I found a app that captures only the images within the boxes like the image below. Should I use a SurfaceView ? or are there some other technique to do this ? I made a camera app with surfaceview and thinking about implementing a blue box like the image below so that I can take the images within the 2 blue boxes.
You can captures the whole image, but just crop the target area after capturing. :)

Implementing a crop image in Android

I am trying to implement a crop image for my app.
What I want to do is that I've an imageview set to 300x300 .I am taking images from
CAMERA and GALLERY now the images can be bigger than 300x300. I want to implement
a cropping tool using which I can drag the image inside imageview so that I can select the useful portion of 300x300 of the image.
I want to implement the same feature which this app implemented for cropping.
Can anyone point me in the right direction ?
Try this:
https://github.com/biokys/cropimage
But if you want to drag and fit useful portion of a image in a Imageview than you can use MultiTouch View.
https://code.google.com/p/android-multitouch-controller/
You can move the image on a custom view. Zoom and Pinch. Once you found the useful area. Take a screenshot of the imageview.
hope any of the solutions helps :)

Categories

Resources