Screenshot of zoomed area of textureview - android

i am facing a problem with my code.
I have used textureview to display camera streaming and i can zoom it as well.
Now my problem is want to take screenshot of zoomed area but when i do that in code it saved whole image what camera is capturing, not only the zoomed area.
So is there any solution where i can screenshot only those content what i have zoomed rather that whole orignal textureview?

Related

Display camera preview in a circle

I want to display a camera preview in a circular shape using the camera2 api. I want to display the preview in a circular shape, but I dont't want the image to be captured in a circular shape.
The captured image would be a face( later want to implement face detection and auto capture). I did have a look at few questions already asked, but none of them are with the new camera2 api's and most of them talk about having an overlay image cropped with a transparent circle. But this will not work in a case where I need to auto detect a face(as the face may appear out side the cropped circular image).
Is there any way I can implement this ? I did try an example with TextureView and set it to a LinearLayout with fixed width and height, but the preview appeared a bit squeezed and in a square shape.
I don't see why face detection matters here - if you enable the camera API's face detector, it'll run on the full image no matter what you do in drawing it inside a circle.
You can either use a circle overlay on top of a correctly-shaped TextureView or SurfaceView, or do your own OpenGL rendering of a circle with the camera preview as a EGL texture.
The latter you'll probably want a GLSurfaceView for the OpenGL drawing context, and a SurfaceTexture to send camera data to and expose it as a EGL texture.
JPEGs captured will still be full-FOV, and the camera API will know nothing about your circular preview drawing, so face detection and everything else will work on the full field of view.

Camera screen orientation issue in titanium appcelerator

I have some issue in device orientation. What i did is that, i have to open camera for screen capture. The camera view is customized by using overlay. Overlay contains a button view, when click on it it will capture image.
I implement device orientation in it. When custom camera opens it looks fine. But when we rotate(that is, rotate to 180 degree) the over lay looks fine, but the camera view inverted the screen. That is for example, if we wish to capture a tree by rotating device, it'll see like upside down and when after capture, the image also inverted. Does anybody have any idea about how to remove this camera invert while rotating.
This issue is headache for many devs.
How do you rotate the camera? You have to rotate your overlay and pretend user that user is rotating the camera.
To get More info see this
Explanation is good.

Android Camera custom zoom anywhere on the camera view

Is there a way, in which I can select a focus area on the camera preview by touch gesture and zoom into that specific area?
The short answer is: yes, you can.
If your camera supports video resolution higher than the preview area, zoom in can show more details. Often, it's not the case, and zoomed in picture will not look good.

Android camera preview with fixed bounding box

I want to take a picture of a rectangle shaped object. If the camera preview have a bounding rectangle i can take the picture by placing the object inside the bounding box. I need only that specified(inside the box) area of the image.Now I have developed a Camera App(Using Camera API Not INTENT) which can take pictures and store the pic like the inbuilt camera App.
How to draw a rectangle on the camera preview? and how to crop before saving?
I am using android 2.2
You have to add an camera overlay to achieve this. Take a look at the Samples at samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview. You can have your own layout over the preview area and add your graphic to it.
Check: http://android-er.blogspot.in/2010/12/add-overlay-on-camera-preview.html
and Android: Crop an Image after Taking it With Camera with a Fixed Aspect Ratio for more samples.

Android change camera preview size and position on SurfaceView

I want to make an application that shows a camera preview on a surface view. the SurfaceView fills the screen, but I want to show the preview only on a certain position of the screen, in a smaller square. I want to draw other things later on the surfaceview too, around the preview. My problem is that the preview fills the whole surfaceview. Is there a way to resolve this problem? I read that I can't use more than one SurfaceView at the same time to separate the preview and the drawing.
Thank you for your help!

Categories

Resources