Android camera - how to prevent captured image from showing? - android

I am developing an app that shows a camera preview, takes a picture, and then shows the picture to the user. Since the window size, preview size and camera capture size do not match up, the app crops the resulting image to the correct aspect (and then scales it to the window dimension) before showing it.
The problem I have is this:
At the call to Camera.takePicture() the preview surface is filled with a copy of the captured image. This image is in a different aspect than what was previously shown in preview window, so the image looks stretched. This image is shown for a second before the app can show a new window with the cropped/scaled image.
Is there a way to prevent this last frame from filling the preview window?

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

Taking Picture from camera gives small Image

If i want to take an image from Camera application,it is giving the small Image,If i access from gallery,it gives me enlarged image,Is there anyway to get the enlarged Image of camera .

Android camera ensure fast response onPictureTaken

I have created a custom camera activity (pretty much followed the Android tutorial)
I implemented a SurfaceView to use a preview and an ImageView to display the image taken on OnPictureTaken
Picture taken takes a while to show up and differs from the preview in terms of aspect ratio, size, lighting, white balance. (probably I didn't set the params properly). The quality of the picture doesn't really matter to me. I just want the app to be responsive, ie still picture shows up immediately, and is identical to the preview.
So what I ended up doing was remove the ImageView and only have the SurfaceView. When the camera button is clicked, I stopPreview(). However, now I don't know how to save the SurfaceView content to bitmap/file. From what I read there isn't really a way to SurfaceView to return a bitmap.
What would be a better way to implement the camera? To reiterate, I need to be able to get a bitmap that is identical to the preview, and have that still image shown to the user immediately.

squared output photo similar to preview

I have used the Commonsware-cwac library exactly like the demo app. After resizing the framelayout which the preview is contained in I achieve a squared preview that maintains correct ratio and preview size. However, after I capture I would like to get a a photo with the same size as the preview. Now, when I capture a new photo, the saved photo is much bigger due to the fact that it captures the original and non-squared preview.
How can the output photo capture the same as the preview and no more?
Option #1: You let the library save the image as it does today, then crop the image yourself
Option #2: You fork the library and add in some sort of cropping logic as part of ImageCleanupTask

Scaling a SurfaceView being used for Camera Previw

I'm trying to build an app that shows a preview from the camera, but only shows it in about 1/4 of the screen. I limited my SurfaceView to just that quarter, but my tests show that I'm not getting the full camera preview.
Is there a way to scale this and crop it to my specifications?

Categories

Resources